forked from aiidateam/aiida-core
-
Notifications
You must be signed in to change notification settings - Fork 0
186 lines (156 loc) · 5.46 KB
/
Copy pathnightly.yml
File metadata and controls
186 lines (156 loc) · 5.46 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
name: nightly
on:
schedule:
- cron: 0 0 * * * # Run every day at midnight
pull_request:
paths:
- .github/workflows/nightly.yml
- .github/workflows/setup.sh
- .github/system_tests/test_daemon.py
- .molecule/default/files/**
- src/aiida/storage/psql_dos/migrator.py
- aiida/storage/psql_dos/migrations/**
- tests/storage/psql_dos/migrations/**
- tests/storage/psql_dos/test_nodes.py
workflow_dispatch:
# 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:
mypy:
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- name: Install aiida-core and pre-commit
uses: ./.github/actions/install-aiida-core
with:
python-version: '3.11'
extras: pre-commit
# Full pre-commit runs in locked CI; run mypy additionally here
# with latest compatible dependencies for nightly validation.
from-lock: 'false'
- name: Run mypy
run: pre-commit run mypy --all-files
nightly-tests:
if: github.repository == 'aiidateam/aiida-core' # Prevent running the builds on forks as well
runs-on: ubuntu-24.04
services:
postgres:
image: postgres:12
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
- name: Install aiida-core
id: install
uses: ./.github/actions/install-aiida-core
with:
python-version: '3.11'
from-lock: 'true'
- name: Setup environment
run: .github/workflows/setup.sh
- name: Run pytest nigthly tests
id: pytest-tests
env:
AIIDA_TEST_PROFILE: test_aiida
AIIDA_WARN_v3: 1
run: |
pytest --db-backend psql -m nightly tests/
- name: Run daemon nightly tests
id: daemon-tests
run: .github/workflows/daemon_tests.sh
- name: Slack notification
# Always run this step (otherwise it would be skipped if any of the previous steps fail)
# but only if the `install` or `tests` steps failed.
# Don't run on PRs, the failure is clearly visible in GitHub UI.
# Run only when the `secrets.SLACK_WEBHOOK` is available, which is not the case for forks.
if: >-
always() &&
(steps.install.outcome == 'failure' ||
steps.pytest-tests.outcome == 'failure' ||
steps.daemon-tests.outcome == 'failure') &&
github.event_name != 'pull_request' &&
env.SLACK_WEBHOOK != null
uses: ./.github/actions/slack-notification
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
with:
title: Nightly build of `aiida-core/main` failed
message: The tests of the `nightly.yml` GHA worklow failed.
# Run a subset of test suite to ensure compatibility with latest RabbitMQ releases
rabbitmq-tests:
runs-on: ubuntu-24.04
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
# Currently supported RMQ versions per:
# https://www.rabbitmq.com/docs/which-erlang#compatibility-matrix
# Version 3.10 is currently used by AiiDAlab.
# Version 4.3 broke aiida-core, so the latest supported is 4.2:
# https://github.com/aiidateam/aiida-core/issues/7375
rabbitmq-version: ['3.10', '4.2']
services:
rabbitmq:
image: rabbitmq:${{ matrix.rabbitmq-version }}-management
ports:
- 5672:5672
- 15672:15672
steps:
- uses: actions/checkout@v6
- name: Install aiida-core
id: install
uses: ./.github/actions/install-aiida-core
with:
python-version: '3.11'
from-lock: 'true'
- name: Setup SSH on localhost
run: .github/workflows/setup_ssh.sh
- name: Suppress RabbitMQ version warning
run: verdi config set warnings.rabbitmq_version False
- name: Run tests
id: tests
env:
AIIDA_WARN_v3: 0
run: pytest -s --db-backend sqlite -m 'requires_rmq' tests/
- name: Slack notification
# Always run this step (otherwise it would be skipped if any of the previous steps fail)
# but only if the `install` or `tests` steps failed.
# Don't run on PRs, the failure is clearly visible in GitHub UI.
# Run only when the `secrets.SLACK_WEBHOOK` is available, which is not the case for forks.
if: >-
always() &&
(steps.install.outcome == 'failure' || steps.tests.outcome == 'failure') &&
github.event_name != 'pull_request' &&
env.SLACK_WEBHOOK != null
uses: ./.github/actions/slack-notification
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
with:
title: RabbitMQ nightly tests of `aiida-core/main` failed
message: RabbitMQ (${{ matrix.rabbitmq-version }}) tests in the `nightly.yml` GHA worklow failed.