-
Notifications
You must be signed in to change notification settings - Fork 8
66 lines (53 loc) · 1.49 KB
/
rust.yml
File metadata and controls
66 lines (53 loc) · 1.49 KB
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
name: Rust
on:
push:
branches: ["main"]
pull_request:
env:
CARGO_TERM_COLOR: always
permissions:
checks: write
jobs:
contract:
name: "Smart contract checks"
runs-on: ubuntu-latest
steps:
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.86.0
components: clippy, rustfmt
target: wasm32-unknown-unknown
- name: Checkout sources
uses: actions/checkout@v2
- name: Install cargo-near
run: |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/latest/download/cargo-near-installer.sh | sh
- name: Run rustfmt
run: make fmt
- name: Run clippy
run: make clippy
- name: Run tests
run: make test
relayer:
name: "Relayer checks"
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./relayer
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Run rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path ./relayer/Cargo.toml --all -- --check
- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --manifest-path ./relayer/Cargo.toml --all-targets -- -D warnings -D clippy::pedantic -D clippy::as_conversions
- name: Run tests
run: |
RUST_BACKTRACE=1 cargo test