-
Notifications
You must be signed in to change notification settings - Fork 0
183 lines (183 loc) · 5.87 KB
/
ci-tests.yaml
File metadata and controls
183 lines (183 loc) · 5.87 KB
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
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: "CodeQL check"
runs-on: ubuntu-24.04
permissions:
security-events: write
steps:
- uses: actions/checkout@v6
- uses: github/codeql-action/init@v4
with:
config-file: .github/codeql/config.yml
languages: python
- uses: github/codeql-action/analyze@v4
cwl-conformance:
name: "CWL conformance tests"
strategy:
matrix:
on: [ "ubuntu-24.04", "macos-15-intel" ]
runs-on: ${{ matrix.on }}
env:
POSTGRES_DB: streamflow
POSTGRES_PASSWORD: streamflow
POSTGRES_USER: streamflow
POSTGRES_HOST: 127.0.0.1
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
with:
version: "0.9.16"
- uses: actions/setup-python@v6
with:
python-version: 3.14
- uses: actions/setup-node@v6
with:
node-version: "24"
- name: "Install Docker (MacOS X)"
uses: docker/setup-docker-action@v5
env:
LIMA_START_ARGS: '--vm-type=vz --mount-type=virtiofs --mount /private/var/folders:w'
if: ${{ startsWith(matrix.on, 'macos-') }}
- uses: docker/setup-qemu-action@v4
if: ${{ startsWith(matrix.on, 'ubuntu-') }}
- name: "Start PostgreSQL Docker container"
run: |
docker run \
--rm \
--detach \
--env POSTGRES_DB=${{ env.POSTGRES_DB }} \
--env POSTGRES_PASSWORD=${{ env.POSTGRES_DB }} \
--env POSTGRES_USER=${{ env.POSTGRES_DB }} \
--publish 5432:5432 \
postgres:18.1-alpine
- name: "Install Postgresql client"
run: brew install libpq@17
if: ${{ startsWith(matrix.on, 'macos-') }}
- name: "Download CWL conformance test script from StreamFlow"
run: |
curl -fsSL https://raw.githubusercontent.com/alpha-unito/streamflow/refs/tags/0.2.0rc1/cwl-conformance-test.sh -o cwl-conformance-test.sh
chmod 755 cwl-conformance-test.sh
- name: "Test CWL v1.3 conformance"
env:
VERSION: "v1.3"
COMMIT: "2063e9095f421f2a2ce12abaf196b2ba06ca5aae"
EXCLUDE: "docker_entrypoint,modify_file_content"
DOCKER: "docker"
run: ./cwl-conformance-test.sh
- name: "Upload test results"
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v6
with:
flags: ${{ startsWith(matrix.on, 'macos-') && 'macos' || 'ubuntu' }}
report_type: test_results
token: ${{ secrets.CODECOV_TOKEN }}
- name: "Upload coverage report for conformance tests"
uses: actions/upload-artifact@v7
with:
name: ${{ format('{0}-py3.14-cwlv1.3-docker-conformance-tests', matrix.on) }}
path: |
./coverage.xml
retention-days: 1
if-no-files-found: error
static-checks:
name: "Static checks"
runs-on: ubuntu-24.04
strategy:
matrix:
step: [ "bandit", "lint" ]
env:
TOXENV: ${{ matrix.step }}
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
with:
version: "0.9.16"
- uses: actions/setup-python@v6
with:
python-version: 3.14
- name: "Install Tox"
run: uv tool install tox --with tox-uv
- name: "Run static analysis via Tox"
run: tox
unit-tests:
name: "Unit tests"
strategy:
matrix:
on: [ "ubuntu-24.04" ]
python: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
include:
- on: "macos-15-intel"
python: "3.14"
runs-on: ${{ matrix.on }}
env:
POSTGRES_DB: streamflow
POSTGRES_PASSWORD: streamflow
POSTGRES_USER: streamflow
POSTGRES_HOST: 127.0.0.1
TOXENV: ${{ format('py{0}-unit', matrix.python) }}
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
with:
version: "0.9.16"
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
- uses: actions/setup-node@v6
with:
node-version: "24"
- name: "Install Docker (MacOs X)"
uses: docker/setup-docker-action@v5
env:
LIMA_START_ARGS: '--vm-type=vz --mount-type=virtiofs --mount /private/var/folders:w'
if: ${{ startsWith(matrix.on, 'macos-') }}
- uses: docker/setup-qemu-action@v4
- name: "Start PostgreSQL Docker container"
run: |
docker run \
--rm \
--detach \
--env POSTGRES_DB=${{ env.POSTGRES_DB }} \
--env POSTGRES_PASSWORD=${{ env.POSTGRES_DB }} \
--env POSTGRES_USER=${{ env.POSTGRES_DB }} \
--publish 5432:5432 \
postgres:18.1-alpine
- name: "Install Postgresql client"
run: brew install libpq@17
if: ${{ startsWith(matrix.on, 'macos-') }}
- name: "Install Tox"
run: uv tool install tox --with tox-uv
- name: "Run tests via Tox"
run: tox
- name: "Upload coverage report for unit tests"
uses: actions/upload-artifact@v7
with:
name: ${{ format('{0}-py{1}-unit-tests', matrix.on, matrix.python) }}
path: ./coverage.xml
retention-days: 1
if-no-files-found: error
upload-to-codecov:
name: "Codecov report upload"
needs: [ "unit-tests" ]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: "Download artifacts"
uses: actions/download-artifact@v8
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v6
with:
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}