Reorganise testing and CI #842
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: Lint and test | |
on: | |
# Run on pushes to master | |
push: | |
branches: | |
- master | |
# And all pull requests | |
pull_request: | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
# Scheduled run over the weekend to detect any upstream breaks. | |
- cron: '0 1 * * 0' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
concurrency: | |
# Cancels jobs running if new commits are pushed | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: "Build and test asQ" | |
# The type of runner that the job will run on | |
# runs-on: ubuntu-latest | |
runs-on: [self-hosted, Linux] | |
# The docker container to use. | |
container: | |
image: firedrakeproject/firedrake-vanilla:latest | |
env: | |
ASQ_CI_TESTS: 1 | |
OMP_NUM_THREADS: 1 | |
OPENBLAS_NUM_THREADS: 1 | |
PYOP2_SPMD_STRICT: 1 | |
# Steps represent a sequence of tasks that will be executed as | |
# part of the jobs | |
steps: | |
- name: Fix permissions | |
# Firedrake's Dockerfile sets USER to firedrake instead of | |
# using the default user, so we need to update file | |
# permissions for this image to work on GH Actions. | |
# See https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners#docker-container-filesystem | |
# (copied from https://help.github.com/en/actions/migrating-to-github-actions/migrating-from-circleci-to-github-actions) | |
run: | | |
sudo chmod -R 777 $GITHUB_WORKSPACE /github /__w/_temp | |
- uses: actions/checkout@v4 | |
- name: Install test dependencies | |
run: | | |
. /home/firedrake/firedrake/bin/activate | |
python -m pip install pytest-timeout | |
python -m pip install pytest-cov | |
# try and reduce the number of warnings to sift through | |
python -m pip install siphash24 | |
- name: Install | |
run: | | |
. /home/firedrake/firedrake/bin/activate | |
python -m pip install -e . | |
python --version | |
python -m pytest --version | |
flake8 --version | |
firedrake-status | |
- name: Lint | |
run: | | |
. /home/firedrake/firedrake/bin/activate | |
flake8 . | |
- name: Test - unit tests | |
run: | | |
. /home/firedrake/firedrake/bin/activate | |
python -m pytest \ | |
-n 12 --dist worksteal \ | |
--durations=40 \ | |
--timeout=300 \ | |
--cov=asQ --cov-report=term \ | |
-v tests/unit | |
- name: Test - integration tests | |
run: | | |
. /home/firedrake/firedrake/bin/activate | |
python -m pytest \ | |
-n 4 --dist worksteal \ | |
--durations=40 \ | |
--timeout=600 \ | |
--cov=asQ --cov-report=term --cov-append \ | |
-v tests/integration |