forked from InsurNiffy/niff-Stellar-shurance
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (71 loc) · 2.18 KB
/
Copy pathcontracts-ci.yml
File metadata and controls
86 lines (71 loc) · 2.18 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Contracts CI
on:
push:
branches:
- main
paths:
- 'contracts/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/contracts-ci.yml'
pull_request:
branches:
- main
paths:
- 'contracts/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/contracts-ci.yml'
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
audit:
name: Security Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # stable
with:
toolchain: stable
- name: Install cargo-audit
run: cargo install cargo-audit --locked
- name: Run cargo audit
run: |
cargo audit --deny warnings \
--ignore RUSTSEC-2024-0388 \
--ignore RUSTSEC-2024-0436 \
--ignore RUSTSEC-2026-0097
ci:
name: Contracts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # stable
with:
toolchain: stable
targets: wasm32v1-none
components: rustfmt, clippy
- name: Cache Rust build artifacts
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
~/.cargo/registry
~/.cargo/git
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Check formatting
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --target wasm32v1-none --release -- -D warnings
- name: Test
run: cargo test --workspace --features testutils
- name: Gas benchmarks
run: cargo test --test gas_benchmarks --features testutils -- --nocapture
- name: Build WASM
run: cargo build --release --target wasm32v1-none --workspace