Skip to content

Commit 8d39a28

Browse files
committed
Add CI cache for test and bench jobs
1 parent f50e7b7 commit 8d39a28

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

.github/workflows/benchmark.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,20 @@ jobs:
2626
- uses: actions/checkout@v4
2727
- uses: dtolnay/rust-toolchain@stable
2828
- uses: arduino/setup-protoc@v3
29+
- uses: baptiste0928/cargo-install@v3
30+
with:
31+
crate: sqlx-cli
2932
- name: Run migrations
30-
run: |
31-
cargo install sqlx-cli
32-
sqlx migrate run --source mix-node/migrations
33+
run: sqlx migrate run --source mix-node/migrations
3334
env:
3435
DATABASE_URL: postgres://username:password@localhost/iris-codes
36+
- uses: actions/cache@v3
37+
with:
38+
path: |
39+
~/.cargo/bin/
40+
~/.cargo/registry/index/
41+
~/.cargo/registry/cache/
42+
~/.cargo/git/db/
43+
target/
44+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
3545
- run: cargo bench

.github/workflows/general.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,22 @@ jobs:
3030
- uses: actions/checkout@v4
3131
- uses: dtolnay/rust-toolchain@stable
3232
- uses: arduino/setup-protoc@v3
33+
- uses: baptiste0928/cargo-install@v3
34+
with:
35+
crate: sqlx-cli
3336
- name: Run migrations
34-
run: |
35-
cargo install sqlx-cli
36-
sqlx migrate run --source mix-node/migrations
37+
run: sqlx migrate run --source mix-node/migrations
3738
env:
3839
DATABASE_URL: postgres://username:password@localhost/iris-codes
40+
- uses: actions/cache@v3
41+
with:
42+
path: |
43+
~/.cargo/bin/
44+
~/.cargo/registry/index/
45+
~/.cargo/registry/cache/
46+
~/.cargo/git/db/
47+
target/
48+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
3949
- run: cargo test --all-features
4050

4151
fmt:

0 commit comments

Comments
 (0)