Skip to content

Commit

Permalink
Cache artifacts in all GitHub Actions when testing locally. (#278)
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Sikora <[email protected]>
  • Loading branch information
PiotrSikora authored Oct 27, 2024
1 parent 36623cd commit 5376967
Showing 1 changed file with 112 additions and 6 deletions.
118 changes: 112 additions & 6 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ jobs:
with:
go-version: '^1.16'

- name: Cache
if: ${{ env.ACT }}
uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
key: licenses-${{ hashFiles('.github/workflows/rust.yml') }}

- name: Check licenses
run: |
go install github.com/google/addlicense@latest
Expand All @@ -53,11 +61,6 @@ jobs:
with:
go-version: '^1.16'

- name: Install dependencies
if: ${{ env.ACT }}
run: |
go install github.com/bazelbuild/[email protected]
- name: Cache
uses: actions/cache@v2
with:
Expand All @@ -66,9 +69,16 @@ jobs:
~/.cache/bazelisk
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/advisory-db
~/.cargo/bin
~/.cargo/registry
key: ${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.Bazel.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }}
~/go/pkg/mod
key: bazel-${{ hashFiles('BUILD', 'WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.Bazel.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }}

- name: Install dependencies
if: ${{ env.ACT }}
run: |
go install github.com/bazelbuild/[email protected]
- name: Build (wasm32-unknown-unknown)
run: bazelisk --noworkspace_rc build --noenable_bzlmod --platforms=@rules_rust//rust/platform:wasm //...
Expand Down Expand Up @@ -96,6 +106,20 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Cache
if: ${{ env.ACT }}
uses: actions/cache@v2
with:
path: |
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/advisory-db
~/.cargo/bin
~/.cargo/registry
~/.rustup
**/target
key: msrv-${{ hashFiles('Cargo.toml') }}

- name: Install dependencies
if: ${{ env.ACT }}
run: |
Expand Down Expand Up @@ -145,6 +169,20 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Cache
if: ${{ env.ACT }}
uses: actions/cache@v2
with:
path: |
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/advisory-db
~/.cargo/bin
~/.cargo/registry
~/.rustup
**/target
key: stable-${{ hashFiles('Cargo.toml') }}

- name: Install dependencies
if: ${{ env.ACT }}
run: |
Expand Down Expand Up @@ -193,6 +231,20 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Cache
if: ${{ env.ACT }}
uses: actions/cache@v2
with:
path: |
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/advisory-db
~/.cargo/bin
~/.cargo/registry
~/.rustup
**/target
key: nightly-${{ hashFiles('Cargo.toml') }}

- name: Install dependencies
if: ${{ env.ACT }}
run: |
Expand Down Expand Up @@ -239,6 +291,19 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Cache
if: ${{ env.ACT }}
uses: actions/cache@v2
with:
path: |
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/advisory-db
~/.cargo/bin
~/.cargo/registry
~/.rustup
key: outdated-${{ hashFiles('Cargo.toml') }}

- name: Install dependencies
if: ${{ env.ACT }}
run: |
Expand All @@ -259,6 +324,19 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Cache
if: ${{ env.ACT }}
uses: actions/cache@v2
with:
path: |
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/advisory-db
~/.cargo/bin
~/.cargo/registry
~/.rustup
key: audit-${{ hashFiles('Cargo.toml') }}

- name: Install dependencies
if: ${{ env.ACT }}
run: |
Expand Down Expand Up @@ -298,6 +376,20 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Cache
if: ${{ env.ACT }}
uses: actions/cache@v2
with:
path: |
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/advisory-db
~/.cargo/bin
~/.cargo/registry
~/.rustup
**/target
key: example-${{ matrix.example }}-${{ hashFiles('Cargo.toml') }}

- name: Install dependencies
if: ${{ env.ACT }}
run: |
Expand Down Expand Up @@ -364,6 +456,20 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Cache
if: ${{ env.ACT }}
uses: actions/cache@v2
with:
path: |
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/advisory-db
~/.cargo/bin
~/.cargo/registry
~/.rustup
**/target
key: reactor-${{ matrix.example }}-${{ hashFiles('Cargo.toml') }}

- name: Install dependencies
if: ${{ env.ACT }}
run: |
Expand Down

0 comments on commit 5376967

Please sign in to comment.