Skip to content

Commit

Permalink
Add Github Action cache to improve CI time
Browse files Browse the repository at this point in the history
  • Loading branch information
duc-nx committed Aug 9, 2024
1 parent 15bfc3f commit 72fe24a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ on:
branches:
- main

# Define the cache configuration as an anchor
cache-config: &cache-config
uses: actions/cache@v4.0.2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

jobs:
check-fmt:
runs-on: ubuntu-latest
Expand All @@ -21,6 +33,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- *cache-config # Use the cache configuration
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
Expand All @@ -34,6 +47,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- *cache-config
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
Expand All @@ -44,6 +58,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- *cache-config
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
Expand All @@ -54,6 +69,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- *cache-config
- run: rustup target add riscv32i-unknown-none-elf
- run: assets/scripts/smoke.sh examples/src/bin/fib3_profiling.rs
- run: assets/scripts/smoke.sh examples/src/bin/hello.rs
Expand All @@ -63,6 +79,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- *cache-config
- run: rustup target add riscv32i-unknown-none-elf
- run: assets/scripts/test_sdk.sh examples/src/bin/hello.rs

Expand Down

0 comments on commit 72fe24a

Please sign in to comment.