Test PyGEM-notebooks in CI #34
Workflow file for this run
This file contains hidden or 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: '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: | |
| NOTEBOOKS_DIRPATH: ${{ github.workspace }}/PyGEM-notebooks | |
| steps: | |
| - name: 'Checkout the PyGEM-notebooks repo' | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'pygem-community/PyGEM-notebooks' | |
| path: ${{ env.NOTEBOOKS_DIRPATH }} | |
| - 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 |