-
Notifications
You must be signed in to change notification settings - Fork 23
102 lines (85 loc) · 2.87 KB
/
rust.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Rust
on: [push]
env:
CARGO_TERM_COLOR: always
jobs:
find-contracts: # Job that list subdirectories
runs-on: ubuntu-latest
outputs:
dir: ${{ steps.set-dirs.outputs.dir }}
steps:
- uses: actions/checkout@v2
- id: set-dirs
run: echo "::set-output name=dir::$(find ./contracts -name Cargo.toml | jq -R -s -c 'split("\n")[:-1]')"
build-contracts:
runs-on: ubuntu-latest
needs: [find-contracts] # Depends on previous job
strategy:
matrix:
dir: ${{fromJson(needs.find-contracts.outputs.dir)}} # List matrix strategy from directories dynamically
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
- name: Install toolchain
run: rustup target add wasm32-unknown-unknown
- uses: actions-rs/cargo@v1.0.3
with:
command: build
args: --release --target wasm32-unknown-unknown --manifest-path=${{matrix.dir}}
find-packages: # Job that list subdirectories
runs-on: ubuntu-latest
outputs:
dir: ${{ steps.set-dirs.outputs.dir }}
steps:
- uses: actions/checkout@v2
- id: set-dirs
run: echo "::set-output name=dir::$(find ./packages/ -name Cargo.toml | jq -R -s -c 'split("\n")[:-1]')"
check-packages:
runs-on: ubuntu-latest
needs: [find-packages] # Depends on previous job
strategy:
matrix:
dir: ${{fromJson(needs.find-packages.outputs.dir)}} # List matrix strategy from directories dynamically
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/cargo@v1.0.3
with:
command: check
coverage:
name: Collect test coverage
runs-on: ubuntu-latest
# nightly rust might break from time to time
continue-on-error: true
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: wasm32-unknown-unknown
components: llvm-tools-preview
- uses: Swatinem/rust-cache@v2
- name: Install latest nextest release
uses: taiki-e/install-action@nextest
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Collect coverage data
run: cargo llvm-cov nextest --lcov --output-path lcov.info --ignore-filename-regex network_integration\|network_tester\|secretcli\|contract_harness
- name: Upload coverage data to codecov
uses: codecov/codecov-action@v3
with:
files: lcov.info