-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (67 loc) · 2.06 KB
/
cosmwasm-ci.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
71
72
73
74
75
76
77
78
79
80
81
name: cosmwasm-build-pipeline
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build-test-scan-audit:
name: Build, Test, Scan, Audit, Sign
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up cargo cache
id: cache-rust
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.69.0
target: wasm32-unknown-unknown
components: clippy
- name: Install Tools
run: |
cargo install cosmwasm-check --version 1.4.1 --locked || true
cargo install cargo-llvm-cov --version 0.5.35 --locked || true
cargo install cargo-sbom --version 0.8.4 --locked || true
cargo install cargo-sonar --version 0.21.0 --locked || true
- name: Versions
run: |
rustc --version
cargo --version
- name: Build
run: |
RUSTFLAGS='-C link-arg=-s' cargo wasm
cosmwasm-check target/wasm32-unknown-unknown/release/cw_escrow.wasm
- name: Test
run: |
cargo test
cargo llvm-cov --html
cargo llvm-cov report --lcov --output-path target/lcov.info
- name: Inspect
run: |
# cargo fmt --all -- --check
cargo clippy --message-format=json > target/clippy-report.json
cargo sonar --clippy-path target/clippy-report.json
mv sonar-issues.json target/sonar-issues.json
- name: Upload Coverage Report
uses: actions/upload-artifact@v3
with:
name: test-coverage
path: target/llvm-cov/html
- name: Scan
run: |
cargo audit
cargo sbom --output-format cyclone_dx_json_1_4 > target/cdx-sbom.json