-
-
Notifications
You must be signed in to change notification settings - Fork 11
55 lines (52 loc) · 1.72 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
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
jobs:
build_and_test:
name: Rust project - latest
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: rustup target add wasm32-unknown-unknown
- run: cargo install --locked --version 20.3.0 soroban-cli --features opt
- name: Build required did contract wasm
run: |
soroban contract build --package soroban-did-contract
- name: Optimize soroban_did_contract.wasm
run: |
soroban contract optimize --wasm target/wasm32-unknown-unknown/release/soroban_did_contract.wasm
- name: Contract Build
run: |
soroban contract build
- 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/[email protected]
with:
version: 0.22.0
# Due to a bug with cargo-tarpaulin crate with multi-line chain calls, the test coverage was reduced.
# https://github.com/xd009642/tarpaulin/issues/949
args: --all-features --fail-under 97.8 --out Lcov
- name: Upload to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: "./lcov.info"