Skip to content

Test PyGEM-notebooks in CI #33

Test PyGEM-notebooks in CI

Test PyGEM-notebooks in CI #33

Workflow file for this run

name: 'Install PyGEM and Run Test Suite'
on:
push:
branches:
- master
- dev
paths:
- '**.py'
- '.github/workflows/test_suite.yml'
- 'pyproject.toml'
pull_request:
paths:
- '**.py'
- '.github/workflows/test_suite.yml'
- 'pyproject.toml'
# Run test suite every Saturday at 1AM GMT (1 hour after the Docker image is updated)
schedule:
- cron: '0 1 * * 6'
# Stop the workflow if a new one is started
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test_suite:
name: 'Test suite'
runs-on: ubuntu-latest
container:
# Use pygem:latest for master branch and pygem:dev otherwise
image: ghcr.io/pygem-community/pygem:${{ github.ref == 'refs/heads/master' && 'latest' || 'dev' }}
options: --user root
env:
GITHUB_NOTEBOOKS_PATH: $HOME/PyGEM-notebooks
steps:
- name: 'Checkout the PyGEM-notebooks repo'
uses: actions/checkout@v4
with:
repository: 'pygem-community/PyGEM-notebooks'
path: ${{ env.GITHUB_NOTEBOOKS_PATH }}
- name: 'Checkout the PyGEM repo'
id: checkout
uses: actions/checkout@v4
- name: 'Reinstall PyGEM'
run: pip install --break-system-packages -e .
- name: 'Initialize PyGEM'
run: initialize
- name: 'Run tests'
run: |
python3 -m coverage erase
python3 -m pytest --cov=pygem -v --durations=20 pygem/tests