-
Notifications
You must be signed in to change notification settings - Fork 13
258 lines (258 loc) · 8.73 KB
/
ci-tests.yaml
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
name: "CI Tests"
on:
push:
branches:
- master
pull_request:
branches:
- master
concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
code-ql-check:
name: "StreamFlow CodeQL check"
runs-on: ubuntu-22.04
permissions:
security-events: write
steps:
- uses: actions/checkout@v4
- uses: github/codeql-action/init@v2
with:
config-file: .github/codeql/config.yml
languages: python
- uses: github/codeql-action/analyze@v2
cwl-conformance:
name: "CWL conformance tests"
strategy:
matrix:
on: [ "ubuntu-22.04" ]
python: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
version: [ "v1.0", "v1.1", "v1.2" ]
docker: [ "docker" ]
include:
- commit: "1c1f122f780075d910fdfdea7e15e46eef3c078d"
exclude: "docker_entrypoint"
version: "v1.0"
- commit: "6397014050177074c9ccd0d771577f7fa9f728a3"
exclude: "docker_entrypoint,stdin_shorcut,inplace_update_on_file_content"
version: "v1.1"
- commit: "1606e546e887629af23d7a804607c9b2de8b721a"
exclude: "docker_entrypoint,modify_file_content"
version: "v1.2"
- docker: "singularity"
commit: "1606e546e887629af23d7a804607c9b2de8b721a"
exclude: "docker_entrypoint,modify_file_content,iwd-container-entryname1"
on: "ubuntu-22.04"
python: "3.12"
version: "v1.2"
- docker: "kubernetes"
commit: "1606e546e887629af23d7a804607c9b2de8b721a"
exclude: "docker_entrypoint,modify_file_content"
on: "ubuntu-22.04"
python: "3.12"
version: "v1.2"
- on: "macos-13"
python: "3.12"
commit: "1606e546e887629af23d7a804607c9b2de8b721a"
exclude: "docker_entrypoint,modify_file_content"
version: "v1.2"
runs-on: ${{ matrix.on }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: |
requirements.txt
test-requirements.txt
- uses: actions/setup-node@v4
with:
node-version: "20"
- name: "Install Docker (MacOS X)"
uses: douglascamata/[email protected]
if: ${{ startsWith(matrix.on, 'macos-') }}
- uses: docker/setup-qemu-action@v3
- name: "Install Apptainer"
uses: eWaterCycle/setup-apptainer@v2
with:
apptainer-version: 1.1.7
if: ${{ matrix.docker == 'singularity' }}
- name: "Install KinD"
uses: helm/kind-action@v1
with:
config: .github/kind/config.yaml
kubectl_version: v1.26.3
version: v0.18.0
if: ${{ matrix.docker == 'kubernetes' }}
- name: "Configure Calico on KinD"
run: |
kubectl apply -f https://docs.projectcalico.org/v3.25/manifests/calico.yaml
kubectl -n kube-system set env daemonset/calico-node FELIX_IGNORELOOSERPF=true
if: ${{ matrix.docker == 'kubernetes' }}
- name: "Install Streamflow"
run: |
python -m pip install . --user
- name: "Test CWL ${{ matrix.version }} conformance"
env:
VERSION: ${{ matrix.version }}
COMMIT: ${{ matrix.commit }}
EXCLUDE: ${{ matrix.exclude }}
DOCKER: ${{ matrix.docker }}
run: ./cwl-conformance-test.sh
- name: "Upload coverage report for conformance tests"
uses: actions/upload-artifact@v3
with:
name: ${{ format('py{0}-cwl{1}-conformance-tests', matrix.python, matrix.version) }}
path: ./coverage.xml
retention-days: 1
if-no-files-found: error
docker-image:
name: "StreamFlow Docker image tests"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: "Build Docker image"
uses: docker/build-push-action@v5
with:
build-args: |
HELM_VERSION=v3.7.2
load: true
tags: alphaunito/streamflow:latest
- name: "Run test with Docker"
run: |
mkdir -p "${TMPDIR:-/tmp}"/project "${TMPDIR:-/tmp}"/results "${TMPDIR:-/tmp}"/streamflow
docker run --rm \
--mount type=bind,source="$(pwd)/tests/cwl-example",target="/streamflow/project" \
--mount type=bind,source="${TMPDIR:-/tmp}"/results,target="/streamflow/results" \
--mount type=bind,source="${TMPDIR:-/tmp}"/streamflow,target="/tmp/streamflow" \
alphaunito/streamflow:latest \
streamflow run /streamflow/project/streamflow.yml
test-flux:
runs-on: ubuntu-latest
permissions:
packages: read
strategy:
fail-fast: false
matrix:
container: ["fluxrm/flux-sched:focal-v0.28.0"]
container:
image: ${{ matrix.container }}
options: "--platform=linux/amd64 --user root -it"
name: ${{ matrix.container }}
steps:
- name: Make Space
run: |
rm -rf /usr/share/dotnet
rm -rf /opt/ghc
- name: Checkout
uses: actions/checkout@v4
- name: Install Streamflow
run: |
pip install .
pip install --upgrade --force-reinstall attrs lockfile
chown -R fluxuser .
- name: Start Flux and Test Workflow
run: |
su fluxuser
cd examples/flux
which streamflow
flux start streamflow run streamflow.yml
static-checks:
name: "StreamFlow static checks"
runs-on: ubuntu-22.04
strategy:
matrix:
step: [ "bandit", "lint" ]
env:
TOXENV: ${{ matrix.step }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.12"
cache: pip
cache-dependency-path: |
requirements.txt
test-requirements.txt
tox.ini
- name: "Install Python Dependencies and Streamflow"
run: |
python -m pip install tox --user
python -m pip install . --user
- name: "Run StreamFlow static analysis via Tox"
run: tox
unit-tests:
name: "StreamFlow unit tests"
strategy:
matrix:
on: [ "ubuntu-22.04"]
python: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
include:
- on: "macos-13"
python: "3.12"
runs-on: ${{ matrix.on }}
env:
TOXENV: ${{ format('py{0}-unit', matrix.python) }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: |
requirements.txt
tox.ini
- uses: actions/setup-node@v4
with:
node-version: "20"
- name: "Install Docker (MacOs X)"
uses: douglascamata/[email protected]
if: ${{ startsWith(matrix.on, 'macos-') }}
- uses: docker/setup-qemu-action@v3
- name: "Install Apptainer"
uses: eWaterCycle/setup-apptainer@v2
with:
apptainer-version: 1.1.7
if: ${{ startsWith(matrix.on, 'ubuntu-') }}
- name: "Install KinD"
uses: helm/kind-action@v1
with:
config: .github/kind/config.yaml
kubectl_version: v1.26.3
version: v0.18.0
if: ${{ startsWith(matrix.on, 'ubuntu-') }}
- name: "Configure Calico on KinD"
run: |
kubectl apply -f https://docs.projectcalico.org/v3.25/manifests/calico.yaml
kubectl -n kube-system set env daemonset/calico-node FELIX_IGNORELOOSERPF=true
if: ${{ startsWith(matrix.on, 'ubuntu-') }}
- name: "Install Python Dependencies and Streamflow"
run: |
python -m pip install tox --user
python -m pip install . --user
- name: "Run StreamFlow tests via Tox"
run: python -m tox
- name: "Upload coverage report for unit tests"
uses: actions/upload-artifact@v3
with:
name: ${{ format('py{0}-unit-tests', matrix.python) }}
path: ./coverage.xml
retention-days: 1
if-no-files-found: error
upload-to-codecov:
name: "Codecov report upload"
needs: ["cwl-conformance", "unit-tests"]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: "Download artifacts"
uses: actions/download-artifact@v3
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}