-
Notifications
You must be signed in to change notification settings - Fork 7
118 lines (105 loc) · 2.83 KB
/
audit.yaml
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
name: Audit
on:
pull_request:
paths:
- 'Cargo.lock'
- 'Cargo.toml'
- 'rust-toolchain.toml'
- '.rustfmt.toml'
- 'crates/**'
- 'deny.toml'
- '.github/workflows/**'
push:
branches:
- main
- staging
- trying
paths:
- 'Cargo.lock'
- 'Cargo.toml'
- 'rust-toolchain.toml'
- '.rustfmt.toml'
- 'crates/**'
- 'deny.toml'
- '.github/workflows/**'
schedule:
- cron: '35 16 * * 1'
defaults:
run:
shell: bash
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUST_BACKTRACE: 1
RUSTUP_MAX_RETRIES: 10
CARGO_TERM_COLOR: always
CLICOLOR: 1
jobs:
security_audit:
permissions:
issues: write # to create issues (actions-rs/audit-check)
checks: write # to create check (actions-rs/audit-check)
runs-on: ubuntu-latest
# Prevent sudden announcement of a new advisory from failing ci:
continue-on-error: true
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
cargo_deny:
permissions:
issues: write # to create issues (actions-rs/audit-check)
checks: write # to create check (actions-rs/audit-check)
runs-on: ubuntu-latest
strategy:
matrix:
checks:
- bans licenses sources
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check ${{ matrix.checks }}
rust-version: stable
rust-clippy-analyze:
name: Run rust-clippy analyzing
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy
- name: Install clippy-sarif
uses: baptiste0928/cargo-install@v3
with:
crate: clippy-sarif
- name: Install sarif-fmt
uses: baptiste0928/cargo-install@v3
with:
crate: sarif-fmt
- name: Run rust-clippy
continue-on-error: true
run: |
cargo clippy \
--all-features \
--all-targets \
--message-format=json \
-- '--allow deprecated' \
| clippy-sarif \
| tee rust-clippy-results.sarif \
| sarif-fmt
- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: rust-clippy-results.sarif
wait-for-processing: true