Skip to content

Commit

Permalink
GitHub CI: Unique cache keys
Browse files Browse the repository at this point in the history
  • Loading branch information
uklotzde committed Jul 29, 2023
1 parent 08b23f5 commit e3f2e02
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ env:
RUST_BACKTRACE: short

jobs:
build-and-test:
the-job:
strategy:
matrix:
include:
Expand Down Expand Up @@ -78,6 +78,11 @@ jobs:

- name: Cache Rust toolchain and build artifacts
uses: Swatinem/rust-cache@v2
with:
# The cache should not be shared between different jobs and actions.
shared-key: ${{ github.action }}-${{ github.job }}
# Two jobs might share the same default target but have different build targets.
key: ${{ matrix.target }}

- name: Check aoide-core
run: |
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ env:
CARGO_TERM_COLOR: always

jobs:
pre-commit:
the-job:
runs-on: ubuntu-latest

steps:
- name: Setup Python
uses: actions/setup-python@v4
Expand All @@ -39,6 +40,9 @@ jobs:

- name: Cache Rust toolchain and build artifacts
uses: Swatinem/rust-cache@v2
with:
# The cache should not be shared between different jobs and actions.
shared-key: ${{ github.action }}-${{ github.job }}

- name: Detect code style issues (push)
uses: pre-commit/[email protected]
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pre-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ jobs:

- name: Cache Rust toolchain and build artifacts
uses: Swatinem/rust-cache@v2
with:
# The cache should not be shared between different jobs and actions.
shared-key: ${{ github.action }}-${{ github.job }}

- name: Build artifact
run: |
Expand Down Expand Up @@ -105,7 +108,9 @@ jobs:
create-release-draft:
needs: build-and-upload-artifacts
if: startsWith(github.ref, 'refs/tags/v')

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/security-audit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ on:
workflow_dispatch:

jobs:
security-audit:
the-job:
runs-on: ubuntu-latest

steps:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
Expand All @@ -34,6 +35,9 @@ jobs:

- name: Cache Rust toolchain and build artifacts
uses: Swatinem/rust-cache@v2
with:
# The cache should not be shared between different jobs and actions.
shared-key: ${{ github.action }}-${{ github.job }}

- name: Run security audit
run: cargo audit --deny unsound --deny yanked

0 comments on commit e3f2e02

Please sign in to comment.