-
Notifications
You must be signed in to change notification settings - Fork 41
180 lines (168 loc) · 4.85 KB
/
build+test.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
name: Build + Test
on:
- push
- pull_request
jobs:
rustfmt:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cargo-${{ hashFiles('**/Cargo.toml') }}
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
test:
runs-on: ubuntu-20.04
steps:
- name: "Free up disk space"
run: sudo rm -rf /usr/share/dotnet && sudo rm -rf /opt/ghc && sudo rm -rf "/usr/local/share/boost" && sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cargo-${{ hashFiles('**/Cargo.toml') }}
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: llvm-tools-preview
- name: Install Protoc
run: sudo apt-get install protobuf-compiler
- name: Install cargo-llvm-cov
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-llvm-cov
- name: Remove possible stale artifacts
uses: actions-rs/cargo@v1
with:
command: llvm-cov
args: clean --workspace
- name: Run test with coverage instrumentation
uses: actions-rs/cargo@v1
with:
command: llvm-cov
# Fixme: --doctest is not supported in stable. See:
# https://github.com/taiki-e/cargo-llvm-cov/tree/7448e48b438797efb446a98ebd8ff22d3fae5ebe#known-limitations
#args: --all-features --doctests
args: --all-features
- name: Generate coverage report
uses: actions-rs/cargo@v1
with:
command: llvm-cov
args: report --lcov --output-path coverage.lcov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: coverage.lcov
fail_ci_if_error: false
flags: unittests
name: Nimiq code coverage
verbose: true
clippy:
if: github.event_name != 'push' || github.event.pusher.name != 'dependabot[bot]'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cargo-${{ hashFiles('**/Cargo.toml') }}
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- name: Install Protoc
run: sudo apt-get install protobuf-compiler
- uses: actions-rs/clippy-check@v1
with:
name: Clippy Report
token: ${{ secrets.GITHUB_TOKEN }}
args: --release --all-features
web-client:
runs-on: ubuntu-20.04
steps:
- name: "Free up disk space"
run: sudo rm -rf /usr/share/dotnet && sudo rm -rf /opt/ghc && sudo rm -rf "/usr/local/share/boost" && sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cargo-${{ hashFiles('**/Cargo.toml') }}
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install Protoc
run: sudo apt-get install protobuf-compiler
- name: Install wasm-pack
uses: actions-rs/cargo@v1
with:
command: install
args: wasm-pack
- name: Compile to wasm and generate bindings
working-directory: ./web-client
run: wasm-pack build --target web
reconnect-test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install python dependencies
run: pip install scripts/devnet
- uses: actions/cache@v3
with:
path:
~/.cargo/registry
~/.cargo/git
target
key: cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Set up Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install Protoc
run: sudo apt-get install protobuf-compiler
- uses: actions-rs/cargo@v1
with:
command: build
- name: Executes the 4 validators reconnecting scenario
run: |
python3 scripts/devnet/devnet.py -t .github/devnet_topologies/four_validators.toml -r 1
- name: Archive test results
if: always()
uses: actions/upload-artifact@v3
with:
name: reconnect-test-logs
path: |
temp-logs/