Skip to content

Commit 4dc96ac

Browse files
committed
Add CI cache for test and bench jobs
1 parent f50e7b7 commit 4dc96ac

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
32+
- uses: actions/cache@v3
33+
with:
34+
path: |
35+
~/.cargo/bin/
36+
~/.cargo/registry/index/
37+
~/.cargo/registry/cache/
38+
~/.cargo/git/db/
39+
target/
40+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
2941
- name: Run migrations
30-
run: |
31-
cargo install sqlx-cli
32-
sqlx migrate run --source mix-node/migrations
42+
run: sqlx migrate run --source mix-node/migrations
3343
env:
3444
DATABASE_URL: postgres://username:password@localhost/iris-codes
3545
- run: cargo bench

.github/workflows/general.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,20 @@ 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
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') }}
3345
- name: Run migrations
34-
run: |
35-
cargo install sqlx-cli
36-
sqlx migrate run --source mix-node/migrations
46+
run: sqlx migrate run --source mix-node/migrations
3747
env:
3848
DATABASE_URL: postgres://username:password@localhost/iris-codes
3949
- run: cargo test --all-features

0 commit comments

Comments
 (0)