Skip to content

Contribution guide added to PyGEM docs #78

Contribution guide added to PyGEM docs

Contribution guide added to PyGEM docs #78

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:
# Since we are root we need to set PYTHONPATH to be able to find the installed packages
PYTHONPATH: /home/ubuntu/.local/lib/python3.12/site-packages
steps:
- 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: 'Clone the PyGEM-notebooks repo'
run: |
# Use PyGEM-notebook:main for master branch and PyGEM-notebooks:dev otherwise
BRANCH=${GITHUB_REF#refs/heads/}
git clone --depth 1 --branch $([[ "$BRANCH" == "master" ]] && echo "main" || echo "dev") \
https://github.com/pygem-community/PyGEM-notebooks.git
echo "PYGEM_NOTEBOOKS_DIRPATH=$(pwd)/PyGEM-notebooks" >> $GITHUB_ENV
- name: 'Run tests'
run: |
python3 -m coverage erase
python3 -m pytest --cov=pygem -v --durations=20 pygem/tests