Merge pull request #138 from ComputationalPhysiology/pre-commit-ci-up… #564
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: CI | |
on: [push] | |
jobs: | |
build: | |
name: Test on ${{ matrix.os }} with Python ${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
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: | | |
python -m pip install -e ".[test]" | |
- name: Test with pytest with jit | |
run: | | |
python3 -m pytest | |
- name: Test with pytest without jit (to get correct coverage) | |
env: | |
NUMBA_DISABLE_JIT: 1 | |
run: | | |
python3 -m pytest | |
- name: Extract Coverage | |
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' | |
run: | | |
python3 -m coverage report | sed 's/^/ /' >> $GITHUB_STEP_SUMMARY | |
python3 -m coverage json | |
export TOTAL=$(python3 -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])") | |
echo "total=$TOTAL" >> $GITHUB_ENV | |
- name: Upload HTML report. | |
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: html-report | |
path: htmlcov |