nightly #1332
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/** | |
- aiida/storage/psql_dos/migrations/** | |
- tests/storage/psql_dos/migrations/** | |
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: | |
nightly-tests: | |
if: github.repository == 'aiidateam/aiida-core' # Prevent running the builds on forks as well | |
runs-on: ubuntu-latest | |
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@v4 | |
- uses: eWaterCycle/setup-singularity@v7 # for containerized code test | |
with: | |
singularity-version: 3.8.7 | |
- 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' | |
- name: Setup environment | |
run: .github/workflows/setup.sh | |
- name: Run tests | |
id: tests | |
run: .github/workflows/tests_nightly.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, and the `SLACK_WEBHOOK` is available. The latter is not the case for | |
# pull requests that come from forks. This is a limitation of secrets on GHA | |
if: always() && (steps.install.outcome == 'failure' || steps.tests.outcome == 'failure') && env.SLACK_WEBHOOK != null | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_ICON: https://www.materialscloud.org/discover/images/0ba0a17d.aiida-logo-128.png | |
SLACK_CHANNEL: dev-aiida-core | |
SLACK_COLOR: b60205 | |
SLACK_TITLE: Nightly build of `aiida-core/main` failed | |
SLACK_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-latest | |
timeout-minutes: 10 | |
strategy: | |
fail-fast: false | |
matrix: | |
# Currently supported RMQ versions per: | |
# https://www.rabbitmq.com/docs/which-erlang#compatibility-matrix | |
rabbitmq-version: ['3.11', '3.12', '3.13'] | |
services: | |
postgres: | |
image: postgres:16 | |
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:${{ matrix.rabbitmq-version }}-management | |
ports: | |
- 5672:5672 | |
- 15672:15672 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install aiida-core | |
id: install | |
uses: ./.github/actions/install-aiida-core | |
with: | |
python-version: '3.11' | |
- name: Install system dependencies | |
run: sudo apt update && sudo apt install postgresql | |
- 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 -sv -m 'requires_rmq' | |
- 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, and the `SLACK_WEBHOOK` is available. The latter is not the case for | |
# pull requests that come from forks. This is a limitation of secrets on GHA | |
if: always() && (steps.install.outcome == 'failure' || steps.tests.outcome == 'failure') && env.SLACK_WEBHOOK != null | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_ICON: https://www.materialscloud.org/discover/images/0ba0a17d.aiida-logo-128.png | |
SLACK_CHANNEL: dev-aiida-core | |
SLACK_COLOR: b60205 | |
SLACK_TITLE: RabbitMQ nightly tests of `aiida-core/main` failed | |
SLACK_MESSAGE: The rabbitmq tests in the `nightly.yml` GHA worklow failed. |