Skip to content

Commit

Permalink
Rebuild caches before testing
Browse files Browse the repository at this point in the history
  • Loading branch information
mrclary committed Dec 11, 2024
1 parent f61c46a commit 75225cd
Showing 1 changed file with 59 additions and 7 deletions.
66 changes: 59 additions & 7 deletions .github/workflows/purge-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:

jobs:
cleanup:
purge-cache:
runs-on: ubuntu-latest
permissions:
actions: write
Expand All @@ -27,38 +27,90 @@ jobs:
# Last command must be successful so that workflow step does not fail
echo Purging cache is complete.
rebuild-test-caches:
name: ${{ matrix.os }} ${{ matrix.INSTALL_TYPE }} ${{ matrix.PYTHON_VERSION }}
needs: purge-cache
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
INSTALL_TYPE: [pip, conda]
PYTHON_VERSION: [3.8, 3.10, 3.12]
include:
- os: ubuntu-latest
INSTALL_TYPE: conda
PYTHON_VERSION: 3.9
- os: macos-13
INSTALL_TYPE: conda
PYTHON_VERSION: 3.11
- os: windows-latest
INSTALL_TYPE: pip
PYTHON_VERSION: 3.11
- os: windows-latest
INSTALL_TYPE: conda
PYTHON_VERSION: 3.11

steps:
- name: Cache conda
uses: actions/cache@v4
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-cacheconda-install${{ matrix.INSTALL_TYPE }}-${{ matrix.PYTHON_VERSION }}-${{ hashFiles('requirements/*.yml') }}

- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-cachepip-install${{ matrix.INSTALL_TYPE }}-${{ hashFiles('setup.py') }}

- name: Create test environment
if: matrix.INSTALL_TYPE == 'conda'
uses: mamba-org/setup-micromamba@v2
with:
micromamba-version: '1.5.10-0'
environment-file: requirements/main.yml
environment-name: test
cache-downloads: true
cache-downloads-key: micromamba-downloads-test-${{ matrix.PYTHON_VERSION }}
create-args: python=${{ matrix.PYTHON_VERSION }}

build-subrepos:
name: Build subrepos
needs:
- cleanup
- purge-cache
uses: ./.github/workflows/build-subrepos.yml

run-test-files:
name: Run test-files
needs:
- cleanup
- purge-cache
- rebuild-test-caches
uses: ./.github/workflows/test-files.yml

run-test-linux:
name: Run test-linux
needs:
- cleanup
- purge-cache
- rebuild-test-caches
uses: ./.github/workflows/test-linux.yml

run-test-mac:
name: Run test-mac
needs:
- cleanup
- purge-cache
- rebuild-test-caches
uses: ./.github/workflows/test-mac.yml

run-test-remoteclient:
name: Run test-remoteclient
needs:
- cleanup
- purge-cache
- rebuild-test-caches
uses: ./.github/workflows/test-remoteclient.yml

run-test-win:
name: Run test-win
needs:
- cleanup
- purge-cache
- rebuild-test-caches
uses: ./.github/workflows/test-win.yml

0 comments on commit 75225cd

Please sign in to comment.