Make auto-running things less hidden, add runtime testing, small fixes to slicing #46
Workflow file for this run
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: Install, test and assess coverage | |
on: | |
pull_request: | |
branches: [ main ] | |
paths: | |
- 'cogsworth/**' | |
- 'setup.cfg' | |
- 'setup.py' | |
- 'pyproject.toml' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.10', '3.11'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install gsl-bin libgsl0-dev build-essential | |
sudo apt-get install libhdf5-serial-dev | |
python -m pip install --upgrade pip | |
python -m pip install -e .[test] | |
- name: Grab the data you need to test observables | |
run: | | |
# prep the data needed for tests | |
python cogsworth/tests/prep_data.py | |
- name: Test package with pytest and generate coverage report | |
run: | | |
# test with as many cores as possible for speed | |
pytest cogsworth -n=auto --cov=./ --cov-report=xml | |
- name: Get Coverage | |
uses: orgoro/coverage@v3 | |
with: | |
coverageFile: ./coverage.xml | |
token: ${{ secrets.GITHUB_TOKEN }} |