Skip to content

Commit

Permalink
Run cov without numba jit and support GH actions pooch cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
matham committed Jun 6, 2024
1 parent baea2ad commit bb0ed47
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
needs: [linting, manifest]
name: ${{ matrix.os }} py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
env:
# used on unix by pooch for cache dir
XDG_CACHE_HOME: "~/.pooch_cache"
strategy:
matrix:
# Run all supported Python versions on linux
Expand All @@ -41,6 +44,13 @@ jobs:
python-version: "3.11"

steps:
- name: Cache pooch data
uses: actions/cache@v4
with:
path: "~/.pooch_cache"
# hash on conftest in case url changes
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/conftest.py') }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand All @@ -55,6 +65,38 @@ jobs:
python-version: ${{ matrix.python-version }}
secret-codecov-token: ${{ secrets.CODECOV_TOKEN }}

test_numba_disabled:
needs: [ linting, manifest ]
name: Run tests with numba disabled
runs-on: ubuntu-latest
env:
NUMBA_DISABLE_JIT: "1"
# used on unix by pooch for cache dir
XDG_CACHE_HOME: "~/.pooch_cache"

steps:
- name: Cache pooch data
uses: actions/cache@v4
with:
path: "~/.pooch_cache"
# hash on conftest in case url changes
key: ${{ runner.os }}-3.11-${{ hashFiles('**/conftest.py') }}

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
# these libraries enable testing on Qt on linux
- uses: pyvista/setup-headless-display-action@v2
with:
qt: true
# Run test suite with numba disabled
- uses: neuroinformatics-unit/actions/test@v2
with:
python-version: "3.11"
secret-codecov-token: ${{ secrets.CODECOV_TOKEN }}
codecov-flags: "numba"

build_sdist_wheels:
name: Build source distribution
needs: [test]
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ dev = [
"setuptools_scm",
"superqt",
"tox",
"pooch",
]


Expand Down

0 comments on commit bb0ed47

Please sign in to comment.