-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (47 loc) · 1.47 KB
/
rust.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Cargo Tests
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
id: cache
with:
path: |
~/.cargo
target
key: cargo-${{ hashFiles('rust-toolchain.toml', 'Cargo.lock') }}
restore-keys: cargo-
- name: Install Rust
run: |
rustup component add rustfmt
rustup component add clippy
cargo --version
- name: Check Format
run: cargo fmt --all -- --check
# fails if lockfile is out of date
# https://users.rust-lang.org/t/check-if-the-cargo-lock-is-up-to-date-without-building-anything/91048/5
- name: Cargo Lockfile Check
run: cargo update --workspace --locked
- name: Install PocketIC
run: |
curl -sL -o pocket-ic.gz https://github.com/dfinity/pocketic/releases/download/4.0.0/pocket-ic-x86_64-linux.gz
gzip -d pocket-ic.gz
chmod +x pocket-ic
echo "POCKET_IC_BIN=$(pwd)/pocket-ic" >> $GITHUB_ENV
- name: Install ic-wasm
run: cargo install ic-wasm --version 0.3.5
- name: Build Wasm Dummy Issuer
working-directory: dummy-issuer
run: ./build.sh
- name: Create dist folder
run: mkdir -p dummy-relying-party/frontend/dist
- name: Cargo tests
run: cargo test