Unique cache-key for job matrix objects (#88)

* Unique cache-key for job matrix objects

* Update workflow to use object in job matrix

* Restore key should always match startswith

* fixup! Unique cache-key for job matrix objects

* Debug no-matrix

* Tests require overriding workflow/job

* Skip generating matrix_key when no matrix is used

* Install jq for self-hosted runners

* fixup! Install jq for self-hosted runners

* Skip install when not needed

* fixup! Skip install when not needed

* fixup! Skip install when not needed

* Improve `cache-name` description

Co-authored-by: Ian Butterworth <i.r.butterworth@gmail.com>

* Update  description in README

* Use actions/checkout@v4 in example

* add missing period

---------

Co-authored-by: Ian Butterworth <i.r.butterworth@gmail.com>
This commit is contained in:
Curtis Vogt
2024-01-04 19:29:52 -06:00
committed by GitHub
parent fab7d6ae0a
commit 207a5a0786
4 changed files with 41 additions and 18 deletions

View File

@@ -36,7 +36,13 @@ jobs:
needs: generate-key
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
dep:
- name: pandoc_jll
version: "3"
os:
- ubuntu-latest
- windows-latest
- macOS-latest
fail-fast: false
runs-on: ${{ matrix.os }}
env:
@@ -55,7 +61,7 @@ jobs:
@assert !isdir(dir)
- name: Install a small binary
shell: 'julia --color=yes {0}'
run: 'using Pkg; Pkg.add("pandoc_jll")'
run: 'using Pkg; Pkg.add(PackageSpec(name="${{ matrix.dep.name }}", version="${{ matrix.dep.version }}"))'
# Do tests with no matrix also given the matrix is auto-included in cache key
test-save-nomatrix:
@@ -81,7 +87,13 @@ jobs:
needs: [generate-key, test-save]
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
dep:
- name: pandoc_jll
version: "3"
os:
- ubuntu-latest
- windows-latest
- macOS-latest
fail-fast: false
runs-on: ${{ matrix.os }}
env: