From 3221bb9443ec52c8df1472d3bd1e8fdc09471907 Mon Sep 17 00:00:00 2001 From: Derrick Chambers Date: Wed, 11 Mar 2026 15:18:34 +0100 Subject: [PATCH 1/6] try to fix github cache --- .github/actions/cache-test-data/action.yml | 37 ++++++++++-- .github/scripts/cache_test_data.py | 22 +++++++ .github/workflows/get_coverage.yml | 37 ++++++++++++ .github/workflows/prime_test_data_cache.yml | 63 +++++++++++++++++++++ .github/workflows/profile.yml | 39 +++++++++++++ .github/workflows/run_min_dep_tests.yml | 44 +++++++++++++- .github/workflows/runtests.yml | 46 ++++++++++++++- .github/workflows/test_doc_build.yml | 42 ++++++++++++++ 8 files changed, 323 insertions(+), 7 deletions(-) create mode 100644 .github/scripts/cache_test_data.py create mode 100644 .github/workflows/prime_test_data_cache.yml diff --git a/.github/actions/cache-test-data/action.yml b/.github/actions/cache-test-data/action.yml index 35fa4ca1e..a094b5ff1 100644 --- a/.github/actions/cache-test-data/action.yml +++ b/.github/actions/cache-test-data/action.yml @@ -5,6 +5,18 @@ inputs: description: "Cache number. Use != 1 to reset data cache" required: false default: "1" + mode: + description: "One of restore, save, or restore-save" + required: false + default: "restore" + +outputs: + cache-hit: + description: "True if an exact cache key was restored" + value: ${{ steps.restore-test-data.outputs.cache-hit }} + cache-key: + description: "The cache key derived from OS and registry hash" + value: ${{ env.DATA_CACHE_KEY }} runs: using: "composite" @@ -34,12 +46,27 @@ runs: run: | echo "DATA_CACHE_PATH=$(python -c "import pooch; print(pooch.os_cache('dascore'))")" >> $GITHUB_ENV - - name: cache test data - uses: actions/cache@v4 - id: cache-test-data + - name: get data cache key + shell: bash -el {0} + run: | + echo "DATA_CACHE_KEY=data-${{ runner.os }}-${{ env.DATA_REGISTRY_HASH }}-${{ inputs.cache-number }}" >> $GITHUB_ENV + + - name: restore test data cache + if: ${{ inputs.mode == 'restore' || inputs.mode == 'restore-save' }} + uses: actions/cache/restore@v4 + id: restore-test-data with: enableCrossOsArchive: true path: ${{ env.DATA_CACHE_PATH }} - key: data-${{ env.DATA_REGISTRY_HASH }}-${{ inputs.cache-number }} + key: ${{ env.DATA_CACHE_KEY }} restore-keys: | - data-${{ env.DATA_REGISTRY_HASH }}- + data-${{ runner.os }}-${{ env.DATA_REGISTRY_HASH }}- + + - name: save test data cache + if: ${{ inputs.mode == 'save' || inputs.mode == 'restore-save' }} + uses: actions/cache/save@v4 + id: cache-test-data + with: + enableCrossOsArchive: true + path: ${{ env.DATA_CACHE_PATH }} + key: ${{ env.DATA_CACHE_KEY }} diff --git a/.github/scripts/cache_test_data.py b/.github/scripts/cache_test_data.py new file mode 100644 index 000000000..9ef263a60 --- /dev/null +++ b/.github/scripts/cache_test_data.py @@ -0,0 +1,22 @@ +"""Populate the pooch cache with every file in dascore's data registry.""" + +from __future__ import annotations + +from pathlib import Path + +from dascore.utils.downloader import fetch, get_registry_df + + +def main() -> None: + """Fetch every registered test-data file into the local pooch cache.""" + registry = get_registry_df() + total = len(registry) + print(f"Priming DASCore test-data cache with {total} files") + for index, name in enumerate(registry["name"], start=1): + path = Path(fetch(name)) + print(f"[{index}/{total}] {name} -> {path}") + print("Finished priming DASCore test-data cache") + + +if __name__ == "__main__": + main() diff --git a/.github/workflows/get_coverage.yml b/.github/workflows/get_coverage.yml index 9db4eae76..df8f8ec85 100644 --- a/.github/workflows/get_coverage.yml +++ b/.github/workflows/get_coverage.yml @@ -6,7 +6,44 @@ on: - master jobs: + prime_test_data_cache: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: ./.github/actions/load-shared-vars + + - uses: actions/setup-python@v6 + with: + python-version: ${{ env.PYTHON_DEFAULT }} + + - name: Install dascore for cache priming + shell: bash + run: | + python -m pip install --upgrade pip + pip install -e . + + - uses: ./.github/actions/cache-test-data + id: cache-test-data + with: + mode: restore + cache-number: 1 + + - name: Download all registered test data + if: steps.cache-test-data.outputs.cache-hit != 'true' + shell: bash + run: python .github/scripts/cache_test_data.py + + - name: Save primed test data cache + if: steps.cache-test-data.outputs.cache-hit != 'true' + uses: ./.github/actions/cache-test-data + with: + mode: save + cache-number: 1 + calc_coverage: + needs: prime_test_data_cache runs-on: ubuntu-latest steps: diff --git a/.github/workflows/prime_test_data_cache.yml b/.github/workflows/prime_test_data_cache.yml new file mode 100644 index 000000000..b54ccf705 --- /dev/null +++ b/.github/workflows/prime_test_data_cache.yml @@ -0,0 +1,63 @@ +name: PrimeTestDataCache + +on: + workflow_dispatch: + schedule: + - cron: "0 4 * * 1" + push: + branches: + - master + paths: + - "dascore/data_registry.txt" + - ".github/actions/cache-test-data/action.yml" + - ".github/scripts/cache_test_data.py" + - ".github/workflows/prime_test_data_cache.yml" + pull_request: + branches: + - master + paths: + - "dascore/data_registry.txt" + - ".github/actions/cache-test-data/action.yml" + - ".github/scripts/cache_test_data.py" + - ".github/workflows/prime_test_data_cache.yml" + +jobs: + prime_test_data_cache: + name: Prime test data cache (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + + steps: + - uses: actions/checkout@v4 + + - uses: ./.github/actions/load-shared-vars + + - uses: actions/setup-python@v6 + with: + python-version: ${{ env.PYTHON_DEFAULT }} + + - name: Install dascore + shell: bash + run: | + python -m pip install --upgrade pip + pip install -e . + + # The cache key is tied to runner.os and the registry hash, so a hit means + # every file for this OS is already available in the pooch cache. + - uses: ./.github/actions/cache-test-data + id: cache-test-data + with: + mode: restore + + - name: Download all registered test data + if: steps.cache-test-data.outputs.cache-hit != 'true' + shell: bash + run: python .github/scripts/cache_test_data.py + + - name: Save primed test data cache + if: steps.cache-test-data.outputs.cache-hit != 'true' + uses: ./.github/actions/cache-test-data + with: + mode: save diff --git a/.github/workflows/profile.yml b/.github/workflows/profile.yml index f91b870c7..43746e606 100644 --- a/.github/workflows/profile.yml +++ b/.github/workflows/profile.yml @@ -13,8 +13,46 @@ permissions: id-token: write # required for OIDC authentication with CodSpeed jobs: + prime_test_data_cache: + name: Prime test data cache + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-tags: "true" + fetch-depth: '0' + + - uses: ./.github/actions/load-shared-vars + + - uses: actions/setup-python@v6 + with: + python-version: ${{ env.PYTHON_DEFAULT }} + + - name: Install dascore for cache priming + run: | + python -m pip install --upgrade pip + pip install -e . + + - uses: ./.github/actions/cache-test-data + id: cache-test-data + with: + mode: restore + cache-number: 1 + + - name: Download all registered test data + if: steps.cache-test-data.outputs.cache-hit != 'true' + run: python .github/scripts/cache_test_data.py + + - name: Save primed test data cache + if: steps.cache-test-data.outputs.cache-hit != 'true' + uses: ./.github/actions/cache-test-data + with: + mode: save + cache-number: 1 + benchmarks: name: Run benchmarks + needs: prime_test_data_cache runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -34,6 +72,7 @@ jobs: - uses: ./.github/actions/cache-test-data with: + mode: restore cache-number: 1 - name: Run benchmarks diff --git a/.github/workflows/run_min_dep_tests.yml b/.github/workflows/run_min_dep_tests.yml index 8cee0f5f0..df79b295b 100644 --- a/.github/workflows/run_min_dep_tests.yml +++ b/.github/workflows/run_min_dep_tests.yml @@ -11,6 +11,7 @@ on: - 'pyproject.toml' - '**.py' - '.github/workflows/run_min_dep_tests.yml' + - '.github/actions/**/*.yml' env: # Ensure matplotlib doesn't try to show figures in CI @@ -35,8 +36,49 @@ jobs: id: load-vars # Runs the tests on combinations of the supported python/os matrix. - test_code_min_deps: + prime_test_data_cache: needs: setup + timeout-minutes: 20 + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + + steps: + - uses: actions/checkout@v4 + + - uses: ./.github/actions/load-shared-vars + + - uses: actions/setup-python@v6 + with: + python-version: ${{ env.PYTHON_DEFAULT }} + + - name: Install dascore for cache priming + shell: bash + run: | + python -m pip install --upgrade pip + pip install -e . + + - uses: ./.github/actions/cache-test-data + id: cache-test-data + with: + mode: restore + cache-number: 1 + + - name: Download all registered test data + if: steps.cache-test-data.outputs.cache-hit != 'true' + shell: bash + run: python .github/scripts/cache_test_data.py + + - name: Save primed test data cache + if: steps.cache-test-data.outputs.cache-hit != 'true' + uses: ./.github/actions/cache-test-data + with: + mode: save + cache-number: 1 + + test_code_min_deps: + needs: [setup, prime_test_data_cache] timeout-minutes: 25 runs-on: ${{ matrix.os }} strategy: diff --git a/.github/workflows/runtests.yml b/.github/workflows/runtests.yml index 68e105ad7..db7d78159 100644 --- a/.github/workflows/runtests.yml +++ b/.github/workflows/runtests.yml @@ -11,6 +11,7 @@ on: - 'pyproject.toml' - '**.py' - '.github/workflows/*.yml' + - '.github/actions/**/*.yml' env: # used to manually trigger cache reset. Just increment if needed. @@ -37,8 +38,51 @@ jobs: id: load-vars # Runs the tests on combinations of the supported python/os matrix. - test_code: + prime_test_data_cache: needs: setup + timeout-minutes: 20 + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + + steps: + - uses: actions/checkout@v4 + + - uses: ./.github/actions/load-shared-vars + + - uses: actions/setup-python@v6 + with: + python-version: ${{ env.PYTHON_DEFAULT }} + + - name: Install dascore for cache priming + shell: bash + run: | + python -m pip install --upgrade pip + pip install -e . + + # Prime the full pooch cache once per OS before the test matrix starts so + # matrix jobs only consume the shared cache instead of racing to create it. + - uses: ./.github/actions/cache-test-data + id: cache-test-data + with: + mode: restore + cache-number: ${{ env.CACHE_NUMBER }} + + - name: Download all registered test data + if: steps.cache-test-data.outputs.cache-hit != 'true' + shell: bash + run: python .github/scripts/cache_test_data.py + + - name: Save primed test data cache + if: steps.cache-test-data.outputs.cache-hit != 'true' + uses: ./.github/actions/cache-test-data + with: + mode: save + cache-number: ${{ env.CACHE_NUMBER }} + + test_code: + needs: [setup, prime_test_data_cache] timeout-minutes: 25 runs-on: ${{ matrix.os }} strategy: diff --git a/.github/workflows/test_doc_build.yml b/.github/workflows/test_doc_build.yml index 480e7c741..7abd52e28 100644 --- a/.github/workflows/test_doc_build.yml +++ b/.github/workflows/test_doc_build.yml @@ -5,10 +5,52 @@ on: types: [labeled, synchronize] jobs: + prime_test_data_cache: + if: | + (github.event.action == 'labeled' && github.event.label.name == 'documentation') + || (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'documentation')) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-tags: "true" + fetch-depth: '0' + + - uses: ./.github/actions/load-shared-vars + + - uses: actions/setup-python@v6 + with: + python-version: ${{ env.PYTHON_DEFAULT }} + + - name: Install dascore for cache priming + shell: bash + run: | + python -m pip install --upgrade pip + pip install -e . + + - uses: ./.github/actions/cache-test-data + id: cache-test-data + with: + mode: restore + cache-number: 1 + + - name: Download all registered test data + if: steps.cache-test-data.outputs.cache-hit != 'true' + shell: bash + run: python .github/scripts/cache_test_data.py + + - name: Save primed test data cache + if: steps.cache-test-data.outputs.cache-hit != 'true' + uses: ./.github/actions/cache-test-data + with: + mode: save + cache-number: 1 + test_build_docs: if: | (github.event.action == 'labeled' && github.event.label.name == 'documentation') || (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'documentation')) + needs: prime_test_data_cache runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From b5e05fa97d6074067d7a7e80f40f8be234434615 Mon Sep 17 00:00:00 2001 From: Derrick Chambers Date: Wed, 11 Mar 2026 15:25:31 +0100 Subject: [PATCH 2/6] fix codspeed --- .github/scripts/cache_test_data.py | 6 +++--- .github/workflows/profile.yml | 12 +++--------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/scripts/cache_test_data.py b/.github/scripts/cache_test_data.py index 9ef263a60..3c2d7cf38 100644 --- a/.github/scripts/cache_test_data.py +++ b/.github/scripts/cache_test_data.py @@ -11,11 +11,11 @@ def main() -> None: """Fetch every registered test-data file into the local pooch cache.""" registry = get_registry_df() total = len(registry) - print(f"Priming DASCore test-data cache with {total} files") + print(f"Priming DASCore test-data cache with {total} files") # noqa for index, name in enumerate(registry["name"], start=1): path = Path(fetch(name)) - print(f"[{index}/{total}] {name} -> {path}") - print("Finished priming DASCore test-data cache") + print(f"[{index}/{total}] {name} -> {path}") # noqa + print("Finished priming DASCore test-data cache") # noqa if __name__ == "__main__": diff --git a/.github/workflows/profile.yml b/.github/workflows/profile.yml index 43746e606..2b2b78641 100644 --- a/.github/workflows/profile.yml +++ b/.github/workflows/profile.yml @@ -62,21 +62,15 @@ jobs: - uses: ./.github/actions/load-shared-vars - - uses: actions/setup-python@v6 + - uses: ./.github/actions/mamba-install-dascore with: # Defined in .github/actions/load-shared-vars/action.yml python-version: ${{ env.PYTHON_DEFAULT }} - - - name: Install dependencies - run: pip install ".[profile]" - - - uses: ./.github/actions/cache-test-data - with: - mode: restore + install-group-str: "[profile]" cache-number: 1 - name: Run benchmarks uses: CodSpeedHQ/action@v4 with: - mode: instrumentation + mode: simulation run: ./.github/test_code.sh profile From 1020394978df3aabc466a80e33a262f52ef178e0 Mon Sep 17 00:00:00 2001 From: Derrick Chambers Date: Wed, 11 Mar 2026 15:49:29 +0100 Subject: [PATCH 3/6] fix cache? --- .github/actions/cache-test-data/action.yml | 31 ++++++++++++++++------ 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/actions/cache-test-data/action.yml b/.github/actions/cache-test-data/action.yml index a094b5ff1..b2a1d3518 100644 --- a/.github/actions/cache-test-data/action.yml +++ b/.github/actions/cache-test-data/action.yml @@ -29,22 +29,37 @@ runs: echo "This action requires Python to be installed first." exit 1 fi - if ! python -c "import pooch" 2>/dev/null; then - echo "❌ Error: Pooch is not installed" - echo "This action requires Pooch to be installed (pip install pooch or include in dependencies)." - exit 1 - fi - echo "✅ Prerequisites verified: Python and Pooch are available" + echo "✅ Prerequisites verified: Python is available" - name: get data registry hash shell: bash -el {0} run: | - echo "DATA_REGISTRY_HASH=$(python -c "import pooch; print(pooch.file_hash('dascore/data_registry.txt'))")" >> $GITHUB_ENV + python - <<'PY' >> "$GITHUB_ENV" + from hashlib import sha256 + from pathlib import Path + + registry_path = Path("dascore/data_registry.txt") + print(f"DATA_REGISTRY_HASH={sha256(registry_path.read_bytes()).hexdigest()}") + PY - name: get data cache path shell: bash -el {0} run: | - echo "DATA_CACHE_PATH=$(python -c "import pooch; print(pooch.os_cache('dascore'))")" >> $GITHUB_ENV + python - <<'PY' >> "$GITHUB_ENV" + import os + import sys + from pathlib import Path + + home = Path.home() + if sys.platform == "win32": + cache_root = Path(os.environ.get("LOCALAPPDATA", home / "AppData" / "Local")) + elif sys.platform == "darwin": + cache_root = home / "Library" / "Caches" + else: + cache_root = Path(os.environ.get("XDG_CACHE_HOME", home / ".cache")) + + print(f"DATA_CACHE_PATH={cache_root / 'dascore'}") + PY - name: get data cache key shell: bash -el {0} From e7cfa2769b2cd9450e792eccadfd75b9bfcdf3fc Mon Sep 17 00:00:00 2001 From: Derrick Chambers Date: Wed, 11 Mar 2026 15:59:46 +0100 Subject: [PATCH 4/6] try fix codspeed --- .github/workflows/profile.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/profile.yml b/.github/workflows/profile.yml index 2b2b78641..52597cf6e 100644 --- a/.github/workflows/profile.yml +++ b/.github/workflows/profile.yml @@ -73,4 +73,7 @@ jobs: uses: CodSpeedHQ/action@v4 with: mode: simulation - run: ./.github/test_code.sh profile + # CodSpeed does not inherit the shell activation done by the + # micromamba setup step, so run benchmarks explicitly inside the + # dascore environment to ensure pytest and pytest-codspeed resolve. + run: micromamba run -n dascore ./.github/test_code.sh profile From 8c4ac648cf1ae2cbd30b474d9b6e0d8465b9d15e Mon Sep 17 00:00:00 2001 From: Derrick Chambers Date: Wed, 11 Mar 2026 16:28:22 +0100 Subject: [PATCH 5/6] only run benchmarks when label is there --- .github/workflows/profile.yml | 12 ++++++++++++ .github/workflows/run_min_dep_tests.yml | 1 + .github/workflows/runtests.yml | 1 + 3 files changed, 14 insertions(+) diff --git a/.github/workflows/profile.yml b/.github/workflows/profile.yml index 52597cf6e..4d3bb479a 100644 --- a/.github/workflows/profile.yml +++ b/.github/workflows/profile.yml @@ -6,6 +6,12 @@ on: branches: - master pull_request: + types: + - opened + - synchronize + - reopened + - labeled + - unlabeled workflow_dispatch: permissions: @@ -15,6 +21,9 @@ permissions: jobs: prime_test_data_cache: name: Prime test data cache + if: > + github.event_name != 'pull_request' || + contains(github.event.pull_request.labels.*.name, 'benchmark') runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -52,6 +61,9 @@ jobs: benchmarks: name: Run benchmarks + if: > + github.event_name != 'pull_request' || + contains(github.event.pull_request.labels.*.name, 'benchmark') needs: prime_test_data_cache runs-on: ubuntu-latest steps: diff --git a/.github/workflows/run_min_dep_tests.yml b/.github/workflows/run_min_dep_tests.yml index df79b295b..da8552d6e 100644 --- a/.github/workflows/run_min_dep_tests.yml +++ b/.github/workflows/run_min_dep_tests.yml @@ -39,6 +39,7 @@ jobs: prime_test_data_cache: needs: setup timeout-minutes: 20 + if: github.event_name == 'push' || !contains(github.event.pull_request.labels.*.name, 'no_ci') runs-on: ${{ matrix.os }} strategy: matrix: diff --git a/.github/workflows/runtests.yml b/.github/workflows/runtests.yml index db7d78159..b18952190 100644 --- a/.github/workflows/runtests.yml +++ b/.github/workflows/runtests.yml @@ -41,6 +41,7 @@ jobs: prime_test_data_cache: needs: setup timeout-minutes: 20 + if: github.event_name == 'push' || !contains(github.event.pull_request.labels.*.name, 'no_ci') runs-on: ${{ matrix.os }} strategy: matrix: From abef7ede40375188900ae903d4fa4dd2ddab5960 Mon Sep 17 00:00:00 2001 From: Derrick Chambers Date: Wed, 11 Mar 2026 16:36:28 +0100 Subject: [PATCH 6/6] try again to fix CI --- .github/actions/cache-test-data/action.yml | 6 +++--- .github/actions/mamba-install-dascore/action.yml | 5 ++--- .github/workflows/prime_test_data_cache.yml | 11 ++++------- .github/workflows/run_min_dep_tests.yml | 5 +---- .github/workflows/runtests.yml | 9 +++------ 5 files changed, 13 insertions(+), 23 deletions(-) diff --git a/.github/actions/cache-test-data/action.yml b/.github/actions/cache-test-data/action.yml index b2a1d3518..f63f821eb 100644 --- a/.github/actions/cache-test-data/action.yml +++ b/.github/actions/cache-test-data/action.yml @@ -15,7 +15,7 @@ outputs: description: "True if an exact cache key was restored" value: ${{ steps.restore-test-data.outputs.cache-hit }} cache-key: - description: "The cache key derived from OS and registry hash" + description: "The cache key derived from the registry hash" value: ${{ env.DATA_CACHE_KEY }} runs: @@ -64,7 +64,7 @@ runs: - name: get data cache key shell: bash -el {0} run: | - echo "DATA_CACHE_KEY=data-${{ runner.os }}-${{ env.DATA_REGISTRY_HASH }}-${{ inputs.cache-number }}" >> $GITHUB_ENV + echo "DATA_CACHE_KEY=data-${{ env.DATA_REGISTRY_HASH }}-${{ inputs.cache-number }}" >> $GITHUB_ENV - name: restore test data cache if: ${{ inputs.mode == 'restore' || inputs.mode == 'restore-save' }} @@ -75,7 +75,7 @@ runs: path: ${{ env.DATA_CACHE_PATH }} key: ${{ env.DATA_CACHE_KEY }} restore-keys: | - data-${{ runner.os }}-${{ env.DATA_REGISTRY_HASH }}- + data-${{ env.DATA_REGISTRY_HASH }}- - name: save test data cache if: ${{ inputs.mode == 'save' || inputs.mode == 'restore-save' }} diff --git a/.github/actions/mamba-install-dascore/action.yml b/.github/actions/mamba-install-dascore/action.yml index dd3019e1a..3dcdfce72 100644 --- a/.github/actions/mamba-install-dascore/action.yml +++ b/.github/actions/mamba-install-dascore/action.yml @@ -17,14 +17,13 @@ inputs: install-package: description: "If true, install dascore" - default: true + default: "true" required: false - type: boolean cache-number: description: "Cache number. Use != 1 to reset data cache" required: false - default: 1 + default: "1" runs: using: "composite" diff --git a/.github/workflows/prime_test_data_cache.yml b/.github/workflows/prime_test_data_cache.yml index b54ccf705..6f34032d9 100644 --- a/.github/workflows/prime_test_data_cache.yml +++ b/.github/workflows/prime_test_data_cache.yml @@ -23,11 +23,8 @@ on: jobs: prime_test_data_cache: - name: Prime test data cache (${{ matrix.os }}) - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + name: Prime shared test data cache + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -44,8 +41,8 @@ jobs: python -m pip install --upgrade pip pip install -e . - # The cache key is tied to runner.os and the registry hash, so a hit means - # every file for this OS is already available in the pooch cache. + # The cache key is shared across OSes. Each consuming job restores this + # archive into the platform-specific cache path that pooch uses locally. - uses: ./.github/actions/cache-test-data id: cache-test-data with: diff --git a/.github/workflows/run_min_dep_tests.yml b/.github/workflows/run_min_dep_tests.yml index da8552d6e..229110c2a 100644 --- a/.github/workflows/run_min_dep_tests.yml +++ b/.github/workflows/run_min_dep_tests.yml @@ -40,10 +40,7 @@ jobs: needs: setup timeout-minutes: 20 if: github.event_name == 'push' || !contains(github.event.pull_request.labels.*.name, 'no_ci') - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/runtests.yml b/.github/workflows/runtests.yml index b18952190..8e561d711 100644 --- a/.github/workflows/runtests.yml +++ b/.github/workflows/runtests.yml @@ -42,10 +42,7 @@ jobs: needs: setup timeout-minutes: 20 if: github.event_name == 'push' || !contains(github.event.pull_request.labels.*.name, 'no_ci') - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -62,8 +59,8 @@ jobs: python -m pip install --upgrade pip pip install -e . - # Prime the full pooch cache once per OS before the test matrix starts so - # matrix jobs only consume the shared cache instead of racing to create it. + # Prime the shared test-data cache once. Each downstream OS restores this + # archive into the platform-specific cache path that pooch uses locally. - uses: ./.github/actions/cache-test-data id: cache-test-data with: