From 42e8433dab744992ab73f8babce75d52b505e1bf Mon Sep 17 00:00:00 2001 From: Simon Perkins Date: Wed, 31 Jan 2024 16:05:00 +0200 Subject: [PATCH] Cache numba kernels (#294) --- .github/workflows/ci.yml | 19 ++++++++++++++++++- HISTORY.rst | 4 ++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b26cd4e..33e5b512 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -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: | diff --git a/HISTORY.rst b/HISTORY.rst index c014e02e..c4236130 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -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`)