Skip to content

Commit

Permalink
GHA: cache remote test files (#2494)
Browse files Browse the repository at this point in the history
There are again many test failures due to timeouts when accessing remote test files.
Cache those.

Closes #2378
  • Loading branch information
dweindl authored Sep 24, 2024
1 parent e339419 commit 074415e
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/test_python_cplusplus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/test_python_ver_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/test_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down

0 comments on commit 074415e

Please sign in to comment.