generated from kommitters/.template
-
-
Notifications
You must be signed in to change notification settings - Fork 7
62 lines (57 loc) · 1.81 KB
/
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
name: Smart Contract Build & Test
on:
push:
branches:
- main
- "v*.[0-9]"
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
env:
CARGO_TERM_COLOR: always
permissions:
contents: read
jobs:
build_and_test:
name: Rust project - latest
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
coveralls.io:443
crates.io:443
github.com:443
index.crates.io:443
objects.githubusercontent.com:443
static.crates.io:443
static.rust-lang.org:443
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: rustup target add wasm32-unknown-unknown
- name: Contract Build
run: |
cargo build --target wasm32-unknown-unknown --release
- name: Code Verifications
run: |
cargo clippy --all-targets --all-features -- -D warnings
- name: Format code
run: |
cargo fmt --check
- name: Code Tests and coverage
uses: actions-rs/tarpaulin@044a1e5bdace8dd2f727b1af63c1d9a1d3572068 # v0.1.3
with:
version: 0.22.0
args: --all-features --fail-under 97.0 --out Lcov
- name: Upload to Coveralls
uses: coverallsapp/github-action@09b709cf6a16e30b0808ba050c7a6e8a5ef13f8d # master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: "./lcov.info"