-
Notifications
You must be signed in to change notification settings - Fork 0
173 lines (153 loc) · 4.64 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: CI
on:
push:
branches: [main]
paths-ignore: ['**.md']
pull_request:
branches: [main]
paths-ignore: ['**.md']
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
ci:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
# Permissions required to delete previous workflow runs
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication
permissions:
actions: write
defaults:
run:
shell: bash
env:
ENV_VAR0: 'env_val0'
ENV_VAR1: 'env_val1'
ENV_VAR2: 'env_val2'
ENV_VAR3: 'env_val3'
ENV_VAR4: 'env_val4'
steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4
- name: Delete previous scheduled runs except the last one from Linux runner
if: ${{ runner.os == 'Linux' && github.event_name == 'schedule' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
for rid in $(gh run list --json databaseId --jq '.[] | join("")' | tail -n +2); do
gh run delete "$rid";
done
- name: 'Run {enable-in-place: false, enable-dump: true}'
uses: ./
with:
env-files: |
test/test.env
input-files: |
test/test.json
test/test.yaml
enable-in-place: false
enable-dump: true
- name: 'Verify {enable-in-place: false, enable-dump: true}'
run: |
diff test/test.json.env test/expected/test.json
diff test/test.yaml.env test/expected/test.yaml
git restore .
- name: 'Run {enable-in-place: true, enable-dump: true}'
uses: ./
with:
env-files: |
test/test.env
input-files: |
test/test.json
test/test.yaml
enable-in-place: true
enable-dump: true
- name: 'Verify {enable-in-place: true, enable-dump: true}'
run: |
diff test/test.json test/expected/test.json
diff test/test.yaml test/expected/test.yaml
git restore .
- name: 'Run {variables, enable-in-place: false, enable-dump: true}'
uses: ./
with:
env-files: |
test/test.env
input-files: |
test/test.json
test/test.yaml
variables: |
ENV_VAR0
ENV_VAR1
enable-in-place: false
enable-dump: true
- name: 'Verify {variables, enable-in-place: false, enable-dump: true}'
run: |
diff test/test.json.env test/expected/test-variables.json
diff test/test.yaml.env test/expected/test-variables.yaml
git restore .
- name: 'Run {prefixes, enable-in-place: false, enable-dump: true}'
uses: ./
with:
env-files: |
test/test.env
input-files: |
test/test.json
test/test.yaml
prefixes: |
ENV
enable-in-place: false
enable-dump: true
- name: 'Verify {prefixes, enable-in-place: false, enable-dump: true}'
run: |
diff test/test.json.env test/expected/test-prefixes.json
diff test/test.yaml.env test/expected/test-prefixes.yaml
git restore .
- name: 'Run {output-directory, enable-in-place: false, enable-dump: true}'
uses: ./
with:
env-files: |
test/test.env
input-files: |
test/test.json
test/test.yaml
output-directory: ./output
enable-in-place: false
enable-dump: true
- name: 'Run {variables, prefixes, enable-in-place: false, enable-dump: true}'
uses: ./
with:
env-files: |
test/test.env
input-files: |
test/test.json
test/test.yaml
variables: |
TEST_VAR0
TEST_VAR1
prefixes: |
ENV
enable-in-place: false
enable-dump: true
- name: 'Verify {variables, prefixes, enable-in-place: false, enable-dump: true}'
run: |
diff test/test.json.env test/expected/test-variables-prefixes.json
diff test/test.yaml.env test/expected/test-variables-prefixes.yaml
git restore .
- name: 'Run {output-directory, enable-in-place: false, enable-dump: true}'
uses: ./
with:
env-files: |
test/test.env
input-files: |
test/test.json
test/test.yaml
output-directory: ./output
enable-in-place: false
enable-dump: true
- name: 'Verify {output-directory, enable-in-place: false, enable-dump: true}'
run: |
diff output/test.json.env test/expected/test.json
diff output/test.yaml.env test/expected/test.yaml
git restore .