Skip to content

Refactoring and Multiprocessing #57

Refactoring and Multiprocessing

Refactoring and Multiprocessing #57

Workflow file for this run

name: Test package
on:
workflow_dispatch:
release:
types: [ created ]
pull_request:
push:
branches:
- master
jobs:
update:
name: "${{ matrix.test }}_py${{ matrix.python-version }}"
runs-on: ubuntu-latest
strategy:
fail-fast: False
matrix:
# Test coveralls (with numba disabled) and normal pytest
test: [ 'coveralls', 'pytest', ]
# Only do coveralls once; pytest on all python versions
python-version: [3.9, "3.10", "3.11", "3.12"]
exclude:
- python-version: 3.10
test: coveralls
- python-version: 3.11
test: coveralls
- python-version: 3.12
test: coveralls
steps:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install requirements for tests
run: |
pip install --upgrade pip
# Require setuptools for python3.12 as well
pip install setuptools
# Requirements for running the notebooks as a pytest
pip install cython ipython
pip install jinja2==3.0.3
pip install nbconvert nbmake pytest-xdist pytest coverage coveralls pytest-cov pytest-notebook ipython_genutils
# Several optional packages that are imported in the notebooks
pip install git+https://github.com/XENON1T/laidbax
pip install -e .
pip install seaborn matplotlib
- name: Test package
if: matrix.test == 'pytest'
run:
|
pytest --cov wimprates -v --nbmake notebooks/*.ipynb --nbmake-timeout=600 --durations 0 --nb-coverage
coverage run --append --source=wimprates -m pytest -v
- name: Coveralls
env:
NUMBA_DISABLE_JIT: 1
if: matrix.test == 'coveralls'
run:
|
pytest --cov wimprates -v --nbmake notebooks/*.ipynb --nbmake-timeout=600 --durations 0 --nb-coverage
coverage run --append --source=wimprates -m pytest -v
- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls --service=github
- name: goodbye
run: echo "tests done, bye bye"