-
-
Notifications
You must be signed in to change notification settings - Fork 231
309 lines (263 loc) · 9.12 KB
/
ci-tests.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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
name: CI Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: false
env:
TOX_SKIP_MISSING_INTERPRETERS: False
# Rich (pip)
FORCE_COLOR: 1
# Tox
PY_COLORS: 1
# Mypy (see https://github.com/python/mypy/issues/7771)
TERM: xterm-color
MYPY_FORCE_COLOR: 1
MYPY_FORCE_TERMINAL_WIDTH: 200
# Pytest
PYTEST_ADDOPTS: --color=yes
jobs:
tox:
name: Tox
runs-on: ubuntu-22.04
strategy:
matrix:
py-ver-major: [3]
py-ver-minor: [9, 10, 11, 12, 13]
step: [lint, unit, bandit, mypy]
env:
py-semver: ${{ format('{0}.{1}', matrix.py-ver-major, matrix.py-ver-minor) }}
TOXENV: ${{ format('py{0}{1}-{2}', matrix.py-ver-major, matrix.py-ver-minor, matrix.step) }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Singularity and environment-modules
if: ${{ matrix.step == 'unit' || matrix.step == 'mypy' }}
run: |
wget --no-verbose https://github.com/sylabs/singularity/releases/download/v3.10.4/singularity-ce_3.10.4-focal_amd64.deb
sudo apt-get install -y ./singularity-ce_3.10.4-focal_amd64.deb environment-modules
- name: Give the test runner user a name to make provenance happy.
if: ${{ matrix.step == 'unit' || matrix.step == 'mypy' }}
run: sudo usermod -c 'CI Runner' "$(whoami)"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.py-semver }}
allow-prereleases: true
cache: pip
cache-dependency-path: |
requirements.txt
tox.ini
- name: Upgrade setuptools and install tox
run: |
pip install -U pip setuptools wheel
pip install "tox<4" "tox-gh-actions<3"
- name: MyPy cache
if: ${{ matrix.step == 'mypy' }}
uses: actions/cache@v4
with:
path: .mypy_cache/${{ env.py-semver }}
key: mypy-${{ env.py-semver }}
- name: Test with tox
run: APPTAINER_TMPDIR=${RUNNER_TEMP} tox
- name: Upload coverage to Codecov
if: ${{ matrix.step == 'unit' }}
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
tox-style:
name: Linters
runs-on: ubuntu-20.04
strategy:
matrix:
step: [lintreadme, shellcheck, pydocstyle]
env:
py-semver: "3.12"
TOXENV: ${{ format('py312-{0}', matrix.step) }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.py-semver }}
cache: pip
- name: Upgrade setuptools and install tox
run: |
pip install -U pip setuptools wheel
pip install "tox<4" "tox-gh-actions<3"
- if: ${{ matrix.step == 'pydocstyle' && github.event_name == 'pull_request'}}
name: Create local branch for diff-quality for PRs
run: git branch ${{github.base_ref}} origin/${{github.base_ref}}
- name: Test with tox
run: tox
clean_working_dir:
name: No leftovers
runs-on: ubuntu-22.04
env:
py-semver: "3.12"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Singularity and environment-modules
run: |
wget --no-verbose https://github.com/sylabs/singularity/releases/download/v3.10.4/singularity-ce_3.10.4-focal_amd64.deb
sudo apt-get install -y ./singularity-ce_3.10.4-focal_amd64.deb environment-modules
- name: Give the test runner user a name to make provenance happy.
run: sudo usermod -c 'CI Runner' "$(whoami)"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.py-semver }}
cache: pip
- name: install with test dependencies
run: |
pip install -U pip setuptools wheel
pip install --no-build-isolation -rtest-requirements.txt .[deps]
- name: make working directory read-only
run: |
mkdir .pytest_cache
chmod a-w .
- name: run tests
run: APPTAINER_TMPDIR=${RUNNER_TEMP} make test
conformance_tests:
name: CWL conformance
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
cwl-version: [v1.0, v1.1, v1.2]
container: [docker, singularity, podman]
extras: [""]
include:
- cwl-version: v1.2
container: docker
extras: "--fast-parser"
- cwl-version: v1.3.0-dev1
extras: "--relax-path-checks"
steps:
- uses: actions/checkout@v4
- name: Set up Singularity and environment-modules
if: ${{ matrix.container == 'singularity' }}
run: |
wget --no-verbose https://github.com/sylabs/singularity/releases/download/v3.10.4/singularity-ce_3.10.4-jammy_amd64.deb
sudo apt-get install -y ./singularity-ce_3.10.4-jammy_amd64.deb environment-modules
- name: Singularity cache
if: ${{ matrix.container == 'singularity' }}
uses: actions/cache@v4
with:
path: sifcache
key: singularity
- name: Set up Podman
if: ${{ matrix.container == 'podman' }}
run: sudo rm -f /usr/bin/docker ; sudo apt-get install -y podman
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: pip
- name: "Test CWL ${{ matrix.cwl-version }} conformance"
env:
VERSION: ${{ matrix.cwl-version }}
CONTAINER: ${{ matrix.container }}
GIT_TARGET: main
CWLTOOL_OPTIONS: ${{ matrix.cwl-version == 'v1.2' && '--relax-path-checks' || '' }} ${{ matrix.extras }}
run: ./conformance-test.sh
- name: Archive test results
uses: actions/upload-artifact@v4
with:
name: cwl-${{ matrix.cwl-version }}-${{ matrix.container }}${{ matrix.extras }}-conformance-results
path: |
**/cwltool_conf*.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
release_test:
name: cwltool release test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Singularity and environment-modules
run: |
wget --no-verbose https://github.com/sylabs/singularity/releases/download/v3.10.4/singularity-ce_3.10.4-jammy_amd64.deb
sudo apt-get install -y ./singularity-ce_3.10.4-jammy_amd64.deb environment-modules
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: pip
cache-dependency-path: |
requirements.txt
test-requirements.txt
- name: Give the test runner user a name to make provenance happy.
run: sudo usermod -c 'CI Runner' "$(whoami)"
- name: Install packages
run: |
pip install -U pip setuptools wheel
pip install virtualenv
- name: Release test
env:
RELEASE_SKIP: head
run: ./release-test.sh
build_test_container:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: record cwltool version
run: pip install -U setuptools wheel && pip install setuptools_scm[toml] && python setup.py --version
- name: build & test cwltool_module container
run: ./build-cwltool-docker.sh
macos:
name: Test on macos-latest
runs-on: macos-13 # not latest, that is now an Apple Silicon M1, for which seqtk is not yet built on bioconda
env:
TOXENV: py312-unit
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: pip
cache-dependency-path: |
requirements.txt
tox.ini
- name: Upgrade setuptools and install tox
run: |
pip install -U pip setuptools wheel
pip install "tox<4" "tox-gh-actions<3"
# # docker for mac install is not currently stable
# - name: 'SETUP MacOS: load Homebrew cache'
# uses: actions/cache@v4
# if: runner.os == 'macOS'
# with:
# path: |
# ~/Library/Caches/Homebrew/downloads/*--Docker.dmg
# key: brew-actions-setup-docker-1.0.11
# restore-keys: brew-actions-setup-docker-
# - name: setup docker on macos (default stable version)
# uses: docker-practice/actions-setup-docker@master
- name: Test with tox
run: tox
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}