Skip to content

Commit

Permalink
Cache numba kernels (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjperkins authored Jan 31, 2024
1 parent 9f9d085 commit 42e8433
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
needs: check_skip
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
env:
NUMBA_CACHE_DIR: /tmp/numba-cache
strategy:
fail-fast: false
matrix:
Expand All @@ -39,7 +41,22 @@ jobs:
- name: Checkout source
uses: actions/checkout@v3
with:
fetch-depth: 1
fetch-depth: 0

- name: Restore repo times
uses: chetan/git-restore-mtime-action@v2

- name: Create Key and Numba Cache Directory
id: numba-key
run: |
mkdir -p ${{ env.NUMBA_CACHE_DIR }}
echo "timestamp=$(/bin/date -u '+%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
- name: Cache Numba Kernels
uses: actions/cache@v3
with:
key: numba-cache-${{ matrix.python-version }}-${{ steps.numba-key.outputs.timestamp }}
restore-keys: numba-cache-${{ matrix.python-version }}-
path: ${{ env.NUMBA_CACHE_DIR }}

- name: Create a .env file
run: |
Expand Down
4 changes: 4 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
History
=======

X.Y.Z (YYYY-MM-DD)
------------------
* Cache numba kernels between CI runs (:pr:`294`)

0.3.5 (2024-01-30)
------------------
* Update setup.py metadata (:pr:`293`)
Expand Down

0 comments on commit 42e8433

Please sign in to comment.