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
name: CI
on:
push:
pull_request:
schedule:
- cron: "17 6 * * 1"
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
check:
name: Format, lint and test
runs-on: ubuntu-latest
timeout-minutes: 20
if: github.event_name != 'schedule'
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 - uses: dtolnay/rust-toolchain@39008827e6b4319a349e9a42dfc90579dd25f1ca with:
toolchain: stable
components: rustfmt, clippy
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 - run: cargo fmt --all --check
- run: cargo clippy --workspace --all-targets --locked -- -D warnings
- run: cargo test --workspace --locked
audit:
name: Dependency advisories and licences
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 - uses: taiki-e/install-action@fe3acb53a98b62c772db35de75ce0e4595e7ca8c with:
tool: cargo-audit,cargo-about@0.9.3
- run: cargo audit
- name: THIRD-PARTY-LICENSES is current
run: |
scripts/third-party-licenses "$RUNNER_TEMP/THIRD-PARTY-LICENSES"
diff -u THIRD-PARTY-LICENSES "$RUNNER_TEMP/THIRD-PARTY-LICENSES" || {
echo "::error::THIRD-PARTY-LICENSES is out of date: run scripts/third-party-licenses and commit the result"
exit 1
}