diff --git a/.github/workflows/test_python_cplusplus.yml b/.github/workflows/test_python_cplusplus.yml index 2128f4df1a..5ca8076a69 100644 --- a/.github/workflows/test_python_cplusplus.yml +++ b/.github/workflows/test_python_cplusplus.yml @@ -125,6 +125,13 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Cache + uses: actions/cache@v4 + with: + path: | + ~/.cache/pooch + key: ${{ runner.os }}-py${{ matrix.python-version }}-${{ github.job }} + - uses: actions/checkout@v4 - run: git fetch --prune --unshallow @@ -201,6 +208,13 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Cache + uses: actions/cache@v4 + with: + path: | + ~/.cache/pooch + key: ${{ runner.os }}-py${{ matrix.python-version }}-${{ github.job }} + - uses: actions/checkout@v4 - run: git fetch --prune --unshallow @@ -259,6 +273,17 @@ jobs: - name: C++ tests run: scripts/run-cpp-tests.sh + - name: Get Pooch Cache Directory + id: get-pooch-cache + run: | + echo "pooch-cache=$(source venv/bin/activate && python -c 'import pooch; print(pooch.os_cache("pooch"))')" >> $GITHUB_ENV + + - name: Cache Pooch Directory + uses: actions/cache@v4 + with: + path: ${{ env.pooch-cache }} + key: ${{ runner.os }}-py${{ matrix.python-version }}-${{ github.job }} + - name: Python tests run: | scripts/run-python-tests.sh \ @@ -301,6 +326,18 @@ jobs: - name: Get BioNetGen run: scripts/buildBNGL.sh + + - name: Get Pooch Cache Directory + id: get-pooch-cache + run: | + echo "pooch-cache=$(source venv/bin/activate && python -c 'import pooch; print(pooch.os_cache("pooch"))')" >> $GITHUB_ENV + + - name: Cache Pooch Directory + uses: actions/cache@v4 + with: + path: ${{ env.pooch-cache }} + key: ${{ runner.os }}-py${{ matrix.python-version }}-${{ github.job }} + - name: Python tests run: | scripts/run-python-tests.sh \ diff --git a/.github/workflows/test_python_ver_matrix.yml b/.github/workflows/test_python_ver_matrix.yml index da2669b866..55871db7cb 100644 --- a/.github/workflows/test_python_ver_matrix.yml +++ b/.github/workflows/test_python_ver_matrix.yml @@ -60,6 +60,17 @@ jobs: - run: source venv/bin/activate && pip3 install "sympy>=1.12.1" if: matrix.python-version != '3.12' + - name: Get Pooch Cache Directory + id: get-pooch-cache + run: | + echo "pooch-cache=$(source venv/bin/activate && python -c 'import pooch; print(pooch.os_cache("pooch"))')" >> $GITHUB_ENV + + - name: Cache Pooch Directory + uses: actions/cache@v4 + with: + path: ${{ env.pooch-cache }} + key: ${{ runner.os }}-py${{ matrix.python-version }}-${{ github.job }} + - name: Python tests run: | source venv/bin/activate \ diff --git a/.github/workflows/test_windows.yml b/.github/workflows/test_windows.yml index 8b5b3b89f7..08532d8d91 100644 --- a/.github/workflows/test_windows.yml +++ b/.github/workflows/test_windows.yml @@ -77,6 +77,18 @@ jobs: - run: python -m amici + - name: Get Pooch Cache Directory + id: get-pooch-cache + run: | + echo "pooch-cache=$(python -c 'import pooch; print(pooch.os_cache("pooch"))')" >> $GITHUB_ENV + shell: bash + + - name: Cache Pooch Directory + uses: actions/cache@v4 + with: + path: ${{ env.pooch-cache }} + key: ${{ runner.os }}-py${{ matrix.python-version }}-${{ github.job }} + - name: Run Python tests shell: bash run: |