Skip to content

Commit

Permalink
Store build cache on push to main, else read-only
Browse files Browse the repository at this point in the history
  • Loading branch information
lubkoll committed Jul 18, 2024
1 parent 6bbf4db commit f62f74e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/cargo_build_cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Store cargo build cache

on:
push:
branches:
- main
paths:
- 'smart-contracts/**.rs'
- 'smart-contracts/**.toml'
workflow_dispatch:

jobs:
store-build-cache:
- name: Check out repository code
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Rust check
run: cargo check
working-directory: smart-contracts
- name: Store dependencies
uses: actions/cache/save@v4
with:
path: |
~/.cargo
~/go
**/target
key: ${{ runner.os }}-cargo-$GITHUB_SHA
restore-keys: ${{ runner.os }}-cargo
2 changes: 1 addition & 1 deletion .github/workflows/cl_vault.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Restore dependencies
uses: actions/cache@v4
uses: actions/cache/restore@v4
with:
path: |
~/.cargo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rust_basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: dtolnay/rust-toolchain@stable
- name: Restore dependencies
if: env.GIT_DIFF
uses: actions/cache@v4
uses: actions/cache/restore@v4
with:
path: |
~/.cargo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rust_test_tube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Restore dependencies
uses: actions/cache@v4
uses: actions/cache/restore@v4
with:
path: |
~/.cargo
Expand Down

0 comments on commit f62f74e

Please sign in to comment.