-
Notifications
You must be signed in to change notification settings - Fork 121
70 lines (56 loc) · 1.57 KB
/
contracts-tests.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
59
60
61
62
63
64
65
66
67
68
69
70
name: Contracts CI - Tests
on:
pull_request:
branches: [master, main]
paths:
- contracts/**
push:
branches: [master, main]
paths:
- contracts/**
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
GEAR_VERSION: 1.7.0
defaults:
run:
working-directory: contracts
permissions:
contents: write
id-token: write
pages: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
all:
name: Tests
runs-on: kuberunner
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Rust (Stable)
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
profile: minimal
components: rustfmt, clippy
- name: Set up Rust (Nightly)
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: rustfmt
profile: minimal
- name: Install rust-src component
run: rustup component add rust-src --toolchain stable-x86_64-unknown-linux-gnu
- name: Prepare Gear Binary
run: |
mkdir -p target/tmp
wget -qO- https://get.gear.rs/gear-v${{ env.GEAR_VERSION }}-x86_64-unknown-linux-gnu.tar.xz | tar xJ -C target/tmp
- name: Fmt
run: cargo +nightly fmt --all -- --config imports_granularity=Crate,edition=2021
- name: Clippy
run: cargo clippy --release --workspace --all-targets --all-features -- -D warnings
- name: Test
run: cargo test --release --workspace