Skip to content

Commit

Permalink
GHA: Cache .tox directories (#1197)
Browse files Browse the repository at this point in the history
Seems to save about 1-3min for each job. 

Also, slightly increased ci-base/ci-optimze timeout. (This shouldn't keep us from making tests faster, though.)

Hopefully closes #1077
  • Loading branch information
dweindl authored Nov 21, 2023
1 parent 2e49b71 commit 6935cee
Showing 1 changed file with 49 additions and 21 deletions.
70 changes: 49 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@ jobs:
- name: Cache
uses: actions/cache@v3
with:
path: ~/.cache
key: ${{ runner.os }}-${{ matrix.python-version }}-ci-base
path: |
~/.cache
.tox/
key: ${{ runner.os }}-${{ matrix.python-version }}-ci-${{ github.job }}

- name: Install dependencies
run: .github/workflows/install_deps.sh amici

- name: Run tests
timeout-minutes: 25
timeout-minutes: 30
run: tox -e base
env:
CC: clang
Expand Down Expand Up @@ -72,7 +74,10 @@ jobs:
- name: Cache
uses: actions/cache@v3
with:
path: ~/.cache
path: |
~/.cache
.tox/
~/Library/Caches/Homebrew
key: ${{ runner.os }}-${{ matrix.python-version }}-ci

- name: Install dependencies
Expand Down Expand Up @@ -103,6 +108,14 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Cache
uses: actions/cache@v3
with:
path: |
~\AppData\Local\pip\Cache
.tox
key: ${{ runner.os }}-${{ matrix.python-version }}-ci

- name: Install dependencies
run: |
pip install --upgrade pip
Expand Down Expand Up @@ -131,8 +144,10 @@ jobs:
- name: Cache
uses: actions/cache@v3
with:
path: ~/.cache
key: ${{ runner.os }}-${{ matrix.python-version }}-ci-petab
path: |
~/.cache
.tox/
key: ${{ runner.os }}-${{ matrix.python-version }}-ci-${{ github.job }}

- name: Install dependencies
run: .github/workflows/install_deps.sh amici pysb
Expand Down Expand Up @@ -175,8 +190,9 @@ jobs:
with:
path: |
~/.cache
.tox/
~/.julia/artifacts
key: ${{ runner.os }}-${{ matrix.python-version }}-ci-julia
key: ${{ runner.os }}-${{ matrix.python-version }}-ci-${{ github.job }}

- name: Install dependencies
run: .github/workflows/install_deps.sh
Expand Down Expand Up @@ -213,14 +229,16 @@ jobs:
- name: Cache
uses: actions/cache@v3
with:
path: ~/.cache
key: ${{ runner.os }}-${{ matrix.python-version }}-ci-optimize
path: |
~/.cache
.tox/
key: ${{ runner.os }}-${{ matrix.python-version }}-ci-${{ github.job }}

- name: Install dependencies
run: .github/workflows/install_deps.sh ipopt

- name: Run tests
timeout-minutes: 20
timeout-minutes: 25
run: tox -e optimize

- name: Coverage
Expand All @@ -247,8 +265,10 @@ jobs:
- name: Cache
uses: actions/cache@v3
with:
path: ~/.cache
key: ${{ runner.os }}-${{ matrix.python-version }}-ci-hierarchical
path: |
~/.cache
.tox/
key: ${{ runner.os }}-${{ matrix.python-version }}-ci-${{ github.job }}

- name: Install dependencies
run: .github/workflows/install_deps.sh amici
Expand Down Expand Up @@ -281,8 +301,10 @@ jobs:
- name: Cache
uses: actions/cache@v3
with:
path: ~/.cache
key: ${{ runner.os }}-${{ matrix.python-version }}-ci-select
path: |
~/.cache
.tox/
key: ${{ runner.os }}-${{ matrix.python-version }}-ci-${{ github.job }}

- name: Install dependencies
run: .github/workflows/install_deps.sh amici
Expand Down Expand Up @@ -318,7 +340,7 @@ jobs:
path: |
~/.cache
.tox/
key: ${{ runner.os }}-${{ matrix.python-version }}-ci-quality
key: ${{ runner.os }}-${{ matrix.python-version }}-ci-${{ github.job }}

- name: Install dependencies
run: pip install tox pre-commit
Expand Down Expand Up @@ -347,8 +369,10 @@ jobs:
- name: Cache
uses: actions/cache@v3
with:
path: ~/.cache
key: ${{ runner.os }}-${{ matrix.python-version }}-ci-docs
path: |
~/.cache
.tox/
key: ${{ runner.os }}-${{ matrix.python-version }}-ci-${{ github.job }}

- name: Install dependencies
run: .github/workflows/install_deps.sh doc amici
Expand Down Expand Up @@ -378,8 +402,10 @@ jobs:
- name: Cache
uses: actions/cache@v3
with:
path: ~/.cache
key: ${{ runner.os }}-${{ matrix.python-version }}-ci-notebooks1
path: |
~/.cache
.tox/
key: ${{ runner.os }}-${{ matrix.python-version }}-ci-${{ github.job }}

- name: Install dependencies
run: .github/workflows/install_deps.sh amici ipopt
Expand All @@ -406,8 +432,10 @@ jobs:
- name: Cache
uses: actions/cache@v3
with:
path: ~/.cache
key: ${{ runner.os }}-${{ matrix.python-version }}-ci-notebooks2
path: |
~/.cache
.tox/
key: ${{ runner.os }}-${{ matrix.python-version }}-ci-${{ github.job }}

- name: Install dependencies
run: .github/workflows/install_deps.sh amici
Expand Down

0 comments on commit 6935cee

Please sign in to comment.