-
Notifications
You must be signed in to change notification settings - Fork 258
230 lines (185 loc) · 5.9 KB
/
ci-code.yml
File metadata and controls
230 lines (185 loc) · 5.9 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
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
name: ci-code
on:
push:
branches-ignore: [gh-pages]
pull_request:
branches-ignore: [gh-pages]
paths-ignore: [docs/**]
# https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
# only cancel in-progress jobs or runs for the current workflow - matches against branch & tags
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
FORCE_COLOR: 1
jobs:
tests:
runs-on: ubuntu-24.04
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.14']
database-backend: [psql]
broker-backend: [rmq, zmq]
services:
postgres:
image: postgres:10
env:
POSTGRES_DB: test_aiida
POSTGRES_PASSWORD: ''
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
rabbitmq:
image: rabbitmq:3.8.14-management
ports:
- 5672:5672
- 15672:15672
slurm:
image: xenonmiddleware/slurm:17
ports:
- 5001:22
steps:
- uses: actions/checkout@v6
- name: Install system dependencies
run: sudo apt update && sudo apt install postgresql graphviz
- name: Install aiida-core
uses: ./.github/actions/install-aiida-core
with:
python-version: ${{ matrix.python-version }}
- name: Setup environment
run: .github/workflows/setup.sh
- name: Run test suite
env:
AIIDA_TEST_PROFILE: test_aiida
AIIDA_WARN_v3: 1
run: |
pytest -n auto --db-backend ${{ matrix.database-backend }} --broker-backend ${{ matrix.broker-backend }} -m 'not nightly' tests/ ${{ matrix.python-version == '3.14' && '--cov aiida' || '' }}
- name: Upload coverage report
if: matrix.python-version == 3.14 && github.repository == 'aiidateam/aiida-core'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: aiida-pytests-py3.14
files: ./coverage.xml
fail_ci_if_error: false # don't fail job, if coverage upload fails
- name: Upload coverage artifact
if: matrix.python-version == '3.14'
uses: actions/upload-artifact@v7
with:
name: coverage-${{ matrix.broker-backend }}
include-hidden-files: true
path: |
coverage.xml
.coverage
retention-days: 30
tests-minimum-requirements:
name: test minimum reqs (${{ matrix.python-version }}, ${{ matrix.database-backend }})
runs-on: ubuntu-24.04
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
python-version: ['3.10']
database-backend: [sqlite]
steps:
- uses: actions/checkout@v6
- name: Install graphviz
run: sudo apt update && sudo apt install graphviz
- name: Install aiida-core
uses: ./.github/actions/install-aiida-core
with:
python-version: ${{ matrix.python-version }}
from-lock: 'false'
extras: tests
resolution-strategy: lowest-direct
- name: Setup SSH on localhost
run: .github/workflows/setup_ssh.sh
- name: Run test suite
env:
AIIDA_WARN_v3: 0
run: pytest --disable-warnings -n auto --db-backend ${{ matrix.database-backend }} --broker-backend zmq -m 'not nightly' tests/
tests-presto:
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v6
- name: Install graphviz
run: sudo apt update && sudo apt install graphviz
- name: Install aiida-core
uses: ./.github/actions/install-aiida-core
with:
python-version: '3.14'
- name: Setup SSH on localhost
run: .github/workflows/setup_ssh.sh
- name: Run test suite
env:
AIIDA_WARN_v3: 0
run: pytest -n auto --broker-backend zmq -m 'presto' tests/
verdi:
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- name: Install aiida-core
uses: ./.github/actions/install-aiida-core
with:
python-version: '3.14'
from-lock: 'true'
extras: ''
- name: Run verdi tests
run: .github/workflows/verdi.sh
test-pytest-fixtures:
# Who watches the watchmen?
# Here we test the pytest fixtures in isolation from the rest of aiida-core test suite,
# since they can be used outside of aiida core context, e.g. in plugins.
# Unlike in other workflows in this file, we purposefully don't setup a test profile.
runs-on: ubuntu-24.04
timeout-minutes: 10
services:
postgres:
image: postgres:10
env:
POSTGRES_DB: test_aiida
POSTGRES_PASSWORD: ''
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
rabbitmq:
image: rabbitmq:3.8.14-management
ports:
- 5672:5672
- 15672:15672
steps:
- uses: actions/checkout@v6
- name: Install aiida-core
uses: ./.github/actions/install-aiida-core
with:
python-version: '3.10'
from-lock: 'true'
extras: tests
- name: Setup SSH
run: .github/workflows/setup_ssh.sh
- name: Test new pytest fixtures
run: pytest -v --cov aiida --noconftest tests/tools/pytest_fixtures/
- name: Test legacy pytest fixtures
run: pytest --cov aiida --noconftest .github/test_legacy_pytest_fixtures.py
- name: Upload coverage report
if: github.repository == 'aiidateam/aiida-core'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: test-pytest-fixtures
files: ./coverage.xml
fail_ci_if_error: false # don't fail job, if coverage upload fails