-
-
Notifications
You must be signed in to change notification settings - Fork 288
253 lines (237 loc) · 7.11 KB
/
main.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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
linter:
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade PIP
run: pip install --user --upgrade pip
- name: Install and lint
run: make clean install run-pre-commit
install_test:
needs: linter
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade PIP
continue-on-error: true
run: pip install --user --upgrade pip
- name: Install project and test cli
run: |
python setup.py install
dynaconf init -v FOO=running_on_ci -y
dynaconf -i config.settings write toml -v OTHERVALUE=Hello_CI -y
dynaconf -i config.settings list | grep -c running_on_ci
dynaconf -i config.settings list | grep -c Hello_CI
dynaconf --version
unit_tests_linux:
needs: install_test
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.10", "3.11"]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade PIP
run: pip install --user --upgrade pip
- name: Install project
run: make ciinstall
- name: Run tests
run: make citest
- name: Publish Junit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
with:
files: junit/**/*.xml
check_name: Test Results (Python ${{ matrix.python-version }})
- name: "Upload coverage to Codecov"
if: ${{ matrix.python-version == '3.8' }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
fail_ci_if_error: true
- name: Run codacy-coverage-reporter
if: ${{ matrix.python-version == '3.10' }}
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
# or
# api-token: ${{ secrets.CODACY_API_TOKEN }}
coverage-reports: coverage.xml
unit_tests_mac:
needs: install_test
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.10", "3.11"]
os: [macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade PIP
run: pip install --user --upgrade pip
- name: Install project
run: make ciinstall
- name: Run tests
run: py.test -v --cov-config .coveragerc --cov=dynaconf -l tests/ --junitxml=junit/test-results.xml -m "not integration"
functional_tests_linux_mac:
needs:
- unit_tests_linux
- unit_tests_mac
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.10", "3.11"]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade PIP
run: pip install --user --upgrade pip
- name: Install project
run: make ciinstall
- name: Run functional tests
run: make test_functional
unit_tests_windows:
needs: install_test
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.10", "3.11"]
os: [windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Pip
run: pip install --user --upgrade pip
continue-on-error: true
- name: Install project
run: pip install --use-deprecated=legacy-resolver .[test]
- name: run tests
run: py.test -v -l tests --junitxml=junit/test-results.xml -m "not integration"
functional_tests_windows:
needs: unit_tests_windows
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.10", "3.11"]
os: [windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Pip
continue-on-error: true
run: pip install --user --upgrade pip
- name: Install project
run: pip install --use-deprecated=legacy-resolver .[test]
- name: run tests
run: python tests_functional/runtests.py
redis:
needs: functional_tests_linux_mac
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.10", "3.11"]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
services:
redis:
image: redis
ports:
- 6379:6379
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade PIP
run: pip install --user --upgrade pip
- name: Install project
run: make ciinstall
- name: Run functional tests
run: make test_redis
vault:
needs: functional_tests_linux_mac
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.10", "3.11"]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
services:
vault:
image: vault
ports:
- 8200:8200
env:
VAULT_DEV_ROOT_TOKEN_ID: myroot
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade PIP
run: pip install --user --upgrade pip
- name: Install project
run: make ciinstall
- name: Run functional tests
run: make test_vault
checkpoint:
runs-on: ubuntu-latest
needs:
- linter
- install_test
- unit_tests_windows
- unit_tests_mac
- unit_tests_linux
- functional_tests_linux_mac
- functional_tests_windows
- redis
- vault
steps:
- name: All tests has passed
run: echo "All tests has passed"