Merge pull request #166 from ComputationalPhysiology/pre-commit-ci-up… #649
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: 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@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| 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@v5 | |
| with: | |
| name: html-report | |
| path: htmlcov |