Skip to content

Commit b652d0e

Browse files
authored
chore: cache workflow builds (#21)
1 parent cc11748 commit b652d0e

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

.github/workflows/build-and-test.yml renamed to .github/workflows/main.yml

+11-2
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,22 @@ jobs:
1919
- name: Rust downgrade
2020
run: rustup default 1.67.0
2121
- uses: actions/checkout@v3
22+
- uses: actions/cache@v3
23+
id: cache
24+
with:
25+
path: |
26+
~/.cargo/bin/
27+
~/.cargo/registry/index/
28+
~/.cargo/registry/cache/
29+
~/.cargo/git/db/
30+
target/
31+
key: cargo-${{ hashFiles('**/Cargo.lock') }}
2232
- name: Install wasm32-unknown-unknown target
2333
run: rustup target add wasm32-unknown-unknown
2434
- name: Build contracts
2535
run: ./build.sh
2636
- name: Build mocks
27-
working-directory: ./mocks
28-
run: ./build.sh
37+
run: ./mocks/build.sh
2938
- name: Unit and Integration Tests
3039
run: cargo test --all
3140

mocks/build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22
set -e
33

4-
RUSTFLAGS='-C link-arg=-s' cargo build --target wasm32-unknown-unknown
4+
RUSTFLAGS='-C link-arg=-s' cargo build -p mocks --target wasm32-unknown-unknown

0 commit comments

Comments
 (0)