-
Notifications
You must be signed in to change notification settings - Fork 1
282 lines (241 loc) · 8.61 KB
/
main.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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
on:
push:
branches:
- main
name: main
permissions:
contents: read
jobs:
build:
name: kickable - std build
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
target:
- x86_64-pc-windows-gnu
- aarch64-unknown-linux-gnu
- x86_64-unknown-linux-gnu
steps:
- name: harden runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
with:
egress-policy: audit
- name: checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: install stable
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.target }}
override: true
- name: install rust
run: rustup update ${{ matrix.rust }} && rustup target add ${{ matrix.target }}
- name: install cross-compilation tools
uses: taiki-e/setup-cross-toolchain-action@e0fdbe18d70a8bbed8a44d3319a1842949a63671 # v1.18.0
with:
target: ${{ matrix.target }}
- name: install dependencies
run: |
sudo apt update
sudo apt install protobuf-compiler -y -o Acquire::Retries=5
- name: cargo cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: build-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: build-${{ matrix.target }}-cargo-
- name: build
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
with:
use-cross: false
command: check
args: --verbose --release --all-targets --all-features --target ${{ matrix.target }}
test:
name: kickable - test
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
with:
egress-policy: audit
- name: checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: install toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
with:
profile: minimal
toolchain: stable
override: true
- name: install dependencies
run: |
sudo apt update
sudo apt install protobuf-compiler -y -o Acquire::Retries=5
- name: cargo cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: test-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: test-${{ matrix.target }}-cargo-
- name: test
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
with:
command: test
lint:
name: kickable - lint
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
with:
egress-policy: audit
- name: checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: install stable
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: install dependencies
run: |
sudo apt update
sudo apt install protobuf-compiler -y -o Acquire::Retries=5
- name: cargo cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: lint-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: lint-${{ matrix.target }}-cargo-
- name: cargo fmt
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
with:
command: fmt
args: --all -- --check
- name: cargo clippy
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
with:
command: clippy
args: -- -D warnings
tarpaulin:
name: kickable - coverage
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Harden Runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
with:
egress-policy: audit
- name: checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: install dependencies
run: |
sudo apt update
sudo apt install protobuf-compiler -y -o Acquire::Retries=5
- name: cargo install tarpaulin
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
with:
command: install
args: cargo-tarpaulin
- name: cargo cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: tarpaulin-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: tarpaulin-${{ matrix.target }}-cargo-
- name: cargo tarpaulin
run:
cargo-tarpaulin tarpaulin --ciserver github --coveralls ${{ secrets.COVERALLS }} --out Xml --out Lcov
- name: archive code coverage results
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: code-coverage-report
path: cobertura.xml
- name: upload to Coveralls
uses: coverallsapp/github-action@c203f016dd0ff7855ebef0ed852000c20c117148 # master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: './lcov.info'
- name: Codecov
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
with:
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info,cobertura.xml
name: kickable-rs
verbose: true
audit:
name: kickable - audit
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: harden runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
with:
egress-policy: block
allowed-endpoints: >
azure.archive.ubuntu.com:80
crates.io:443
esm.ubuntu.com:443
github.com:443
index.crates.io:443
motd.ubuntu.com:443
packages.microsoft.com:443
ppa.launchpadcontent.net:443
static.crates.io:443
static.rust-lang.org:443
- name: checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: cargo cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: audit-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: audit-${{ matrix.target }}-cargo-
- name: audit
uses: actions-rs/audit-check@35b7b53b1e25b55642157ac01b4adceb5b9ebef3 # v1.2.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: OSSF scorecard action
uses: ossf/scorecard-action@483ef80eb98fb506c348f7d62e28055e49fe2398 # v2.3.0
with:
results_file: results.sarif
results_format: sarif
publish_results: true
- name: upload to code-scanning
uses: github/codeql-action/upload-sarif@0116bc2df50751f9724a2e35ef1f24d22f90e4e1 # v2.22.3
with:
sarif_file: results.sarif