Skip to content

Commit bf08330

Browse files
authored
Merge pull request #164 from epage/template
style: Make clippy happy
2 parents acb0b2f + 68d88b4 commit bf08330

18 files changed

Lines changed: 200 additions & 92 deletions

.github/renovate.json5

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
extends: ["helpers:pinGitHubActionDigests"],
23
schedule: [
34
'before 5am on the first day of the month',
45
],
@@ -64,12 +65,23 @@
6465
matchDepNames: [
6566
'prek',
6667
],
67-
extractVersion: '^(?<version>\\d+\\.\\d+\\.\\d+)',
68+
extractVersion: '^v(?<version>\\d+\\.\\d+\\.\\d+)',
6869
schedule: [
6970
'* * * * *',
7071
],
7172
automerge: true,
7273
},
74+
{
75+
matchManagers: [
76+
'github-actions',
77+
],
78+
matchUpdateTypes: [
79+
'minor',
80+
'patch',
81+
],
82+
automerge: true,
83+
groupName: 'compatible (actions)',
84+
},
7385
// Goals:
7486
// - Keep version reqs low, ignoring compatible normal/build dependencies
7587
// - Take advantage of latest dev-dependencies

.github/workflows/audit.yml

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
name: Security audit
1+
name: Audit
22

33
permissions:
44
contents: read
55

66
on:
77
pull_request:
8-
paths:
9-
- '**/Cargo.toml'
10-
- '**/Cargo.lock'
118
push:
129
branches:
1310
- master
@@ -22,19 +19,38 @@ concurrency:
2219
cancel-in-progress: true
2320

2421
jobs:
25-
security_audit:
22+
audit:
23+
permissions:
24+
contents: none
25+
name: Audit
26+
needs: [advisories, cargo_deny, actions]
27+
runs-on: ubuntu-latest
28+
if: "always()"
29+
steps:
30+
- name: Failed
31+
run: exit 1
32+
if: "contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped')"
33+
advisories:
2634
permissions:
2735
issues: write # to create issues (actions-rs/audit-check)
2836
checks: write # to create check (actions-rs/audit-check)
2937
runs-on: ubuntu-latest
3038
# Prevent sudden announcement of a new advisory from failing ci:
3139
continue-on-error: true
40+
strategy:
41+
matrix:
42+
checks:
43+
- advisories
3244
steps:
3345
- name: Checkout repository
34-
uses: actions/checkout@v6
35-
- uses: actions-rs/audit-check@v1
46+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
47+
with:
48+
persist-credentials: false
49+
- name: Lint advisories
50+
uses: EmbarkStudios/cargo-deny-action@3fd3802e88374d3fe9159b834c7714ec57d6c979 # v2.0.15
3651
with:
37-
token: ${{ secrets.GITHUB_TOKEN }}
52+
command: check ${{ matrix.checks }}
53+
rust-version: stable
3854

3955
cargo_deny:
4056
permissions:
@@ -46,8 +62,26 @@ jobs:
4662
checks:
4763
- bans licenses sources
4864
steps:
49-
- uses: actions/checkout@v6
50-
- uses: EmbarkStudios/cargo-deny-action@v2
65+
- name: Checkout repository
66+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
67+
with:
68+
persist-credentials: false
69+
- name: Lint bans
70+
uses: EmbarkStudios/cargo-deny-action@3fd3802e88374d3fe9159b834c7714ec57d6c979 # v2.0.15
5171
with:
5272
command: check ${{ matrix.checks }}
5373
rust-version: stable
74+
75+
actions:
76+
runs-on: ubuntu-latest
77+
permissions:
78+
security-events: write
79+
contents: read # only needed for private or internal repos
80+
actions: read # only needed for private or internal repos
81+
steps:
82+
- name: Checkout repository
83+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
84+
with:
85+
persist-credentials: false
86+
- name: Run zizmor
87+
uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2

.github/workflows/ci.yml

Lines changed: 57 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,19 @@ jobs:
4343
CARGO_PROFILE_DEV_DEBUG: line-tables-only
4444
steps:
4545
- name: Checkout repository
46-
uses: actions/checkout@v6
46+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
47+
with:
48+
persist-credentials: false
4749
- name: Install Rust
48-
uses: dtolnay/rust-toolchain@stable
50+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
4951
with:
5052
toolchain: ${{ matrix.rust }}
51-
- uses: Swatinem/rust-cache@v2
52-
- uses: taiki-e/install-action@cargo-hack
53+
- name: Initialize cache
54+
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
55+
- name: Install cargo-hack
56+
uses: taiki-e/install-action@97a5807a604e12de3a13b52d868ebecaeeea757c # v2.75.4
57+
with:
58+
tool: cargo-hack
5359
- name: Build
5460
run: cargo test --workspace --no-run
5561
- name: Test
@@ -62,13 +68,19 @@ jobs:
6268
runs-on: ${{ matrix.os }}
6369
steps:
6470
- name: Checkout repository
65-
uses: actions/checkout@v6
71+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
72+
with:
73+
persist-credentials: false
6674
- name: Install Rust
67-
uses: dtolnay/rust-toolchain@stable
75+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
6876
with:
6977
toolchain: stable
70-
- uses: Swatinem/rust-cache@v2
71-
- uses: taiki-e/install-action@cargo-hack
78+
- name: Initialize cache
79+
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
80+
- name: Install cargo-hack
81+
uses: taiki-e/install-action@97a5807a604e12de3a13b52d868ebecaeeea757c # v2.75.4
82+
with:
83+
tool: cargo-hack
7284
- name: Default features
7385
run: cargo hack check --each-feature --locked --rust-version --ignore-private --workspace --all-targets --keep-going
7486
minimal-versions:
@@ -79,13 +91,15 @@ jobs:
7991
runs-on: ${{ matrix.os }}
8092
steps:
8193
- name: Checkout repository
82-
uses: actions/checkout@v6
94+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
95+
with:
96+
persist-credentials: false
8397
- name: Install stable Rust
84-
uses: dtolnay/rust-toolchain@stable
98+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
8599
with:
86100
toolchain: stable
87101
- name: Install nightly Rust
88-
uses: dtolnay/rust-toolchain@stable
102+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
89103
with:
90104
toolchain: nightly
91105
- name: Downgrade dependencies to minimal versions
@@ -96,25 +110,31 @@ jobs:
96110
runs-on: ubuntu-latest
97111
steps:
98112
- name: Checkout repository
99-
uses: actions/checkout@v6
113+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
114+
with:
115+
persist-credentials: false
100116
- name: Install Rust
101-
uses: dtolnay/rust-toolchain@stable
117+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
102118
with:
103119
toolchain: stable
104-
- uses: Swatinem/rust-cache@v2
120+
- name: Initialize cache
121+
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
105122
- name: "Is lockfile updated?"
106123
run: cargo update --workspace --locked
107124
docs:
108125
name: Docs
109126
runs-on: ubuntu-latest
110127
steps:
111128
- name: Checkout repository
112-
uses: actions/checkout@v6
129+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
130+
with:
131+
persist-credentials: false
113132
- name: Install Rust
114-
uses: dtolnay/rust-toolchain@stable
133+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
115134
with:
116135
toolchain: "1.95" # STABLE
117-
- uses: Swatinem/rust-cache@v2
136+
- name: Initialize cache
137+
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
118138
- name: Check documentation
119139
env:
120140
RUSTDOCFLAGS: -D warnings
@@ -124,13 +144,16 @@ jobs:
124144
runs-on: ubuntu-latest
125145
steps:
126146
- name: Checkout repository
127-
uses: actions/checkout@v6
147+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
148+
with:
149+
persist-credentials: false
128150
- name: Install Rust
129-
uses: dtolnay/rust-toolchain@stable
151+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
130152
with:
131153
toolchain: "1.95" # STABLE
132154
components: rustfmt
133-
- uses: Swatinem/rust-cache@v2
155+
- name: Initialize cache
156+
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
134157
- name: Check formatting
135158
run: cargo fmt --check
136159
clippy:
@@ -140,13 +163,16 @@ jobs:
140163
security-events: write # to upload sarif results
141164
steps:
142165
- name: Checkout repository
143-
uses: actions/checkout@v6
166+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
167+
with:
168+
persist-credentials: false
144169
- name: Install Rust
145-
uses: dtolnay/rust-toolchain@stable
170+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
146171
with:
147172
toolchain: "1.95" # STABLE
148173
components: clippy
149-
- uses: Swatinem/rust-cache@v2
174+
- name: Initialize cache
175+
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
150176
- name: Install SARIF tools
151177
run: cargo install clippy-sarif --locked
152178
- name: Install SARIF tools
@@ -159,7 +185,7 @@ jobs:
159185
| sarif-fmt
160186
continue-on-error: true
161187
- name: Upload
162-
uses: github/codeql-action/upload-sarif@v4
188+
uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
163189
with:
164190
sarif_file: clippy-results.sarif
165191
wait-for-processing: true
@@ -170,17 +196,20 @@ jobs:
170196
runs-on: ubuntu-latest
171197
steps:
172198
- name: Checkout repository
173-
uses: actions/checkout@v6
199+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
200+
with:
201+
persist-credentials: false
174202
- name: Install Rust
175-
uses: dtolnay/rust-toolchain@stable
203+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
176204
with:
177205
toolchain: stable
178-
- uses: Swatinem/rust-cache@v2
206+
- name: Initialize cache
207+
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
179208
- name: Install cargo-tarpaulin
180209
run: cargo install cargo-tarpaulin
181210
- name: Gather coverage
182211
run: cargo tarpaulin --output-dir coverage --out lcov
183212
- name: Publish to Coveralls
184-
uses: coverallsapp/github-action@master
213+
uses: coverallsapp/github-action@09b709cf6a16e30b0808ba050c7a6e8a5ef13f8d # master
185214
with:
186215
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/committed.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ jobs:
2020
name: Lint Commits
2121
runs-on: ubuntu-latest
2222
steps:
23-
- name: Checkout Actions Repository
24-
uses: actions/checkout@v6
23+
- name: Checkout repository
24+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2525
with:
2626
fetch-depth: 0
27+
persist-credentials: false
2728
- name: Lint Commits
28-
uses: crate-ci/committed@master
29+
uses: crate-ci/committed@faeed42f2e10c244533a01525f13c4d8b6ce383f # v1.1.11

.github/workflows/pre-commit.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ jobs:
2222
contents: read
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@v6
26-
- uses: j178/prek-action@v2
25+
- name: Checkout repository
26+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2727
with:
28-
prek-version: '0.2.27'
28+
persist-credentials: false
29+
- name: prek
30+
uses: j178/prek-action@53276d8b0d10f8b6672aa85b4588c6921d0370cc # v2.0.1
31+
with:
32+
prek-version: '0.3.11'

.github/workflows/rust-next.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,19 @@ jobs:
3333
CARGO_PROFILE_DEV_DEBUG: line-tables-only
3434
steps:
3535
- name: Checkout repository
36-
uses: actions/checkout@v6
36+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
37+
with:
38+
persist-credentials: false
3739
- name: Install Rust
38-
uses: dtolnay/rust-toolchain@stable
40+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
3941
with:
4042
toolchain: ${{ matrix.rust }}
41-
- uses: Swatinem/rust-cache@v2
42-
- uses: taiki-e/install-action@cargo-hack
43+
- name: Initialize cache
44+
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
45+
- name: Install cargo-hack
46+
uses: taiki-e/install-action@97a5807a604e12de3a13b52d868ebecaeeea757c # v2.75.4
47+
with:
48+
tool: cargo-hack
4349
- name: Build
4450
run: cargo test --workspace --no-run
4551
- name: Test
@@ -54,13 +60,19 @@ jobs:
5460
CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS: allow
5561
steps:
5662
- name: Checkout repository
57-
uses: actions/checkout@v6
63+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
64+
with:
65+
persist-credentials: false
5866
- name: Install Rust
59-
uses: dtolnay/rust-toolchain@stable
67+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
6068
with:
6169
toolchain: stable
62-
- uses: Swatinem/rust-cache@v2
63-
- uses: taiki-e/install-action@cargo-hack
70+
- name: Initialize cache
71+
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
72+
- name: Install cargo-hack
73+
uses: taiki-e/install-action@97a5807a604e12de3a13b52d868ebecaeeea757c # v2.75.4
74+
with:
75+
tool: cargo-hack
6476
- name: Update dependencies
6577
run: cargo update
6678
- name: Build

.github/workflows/spelling.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: Checkout Actions Repository
23-
uses: actions/checkout@v6
23+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
24+
with:
25+
persist-credentials: false
2426
- name: Spell Check Repo
25-
uses: crate-ci/typos@master
27+
uses: crate-ci/typos@bbaefadf97b0ec5fdc942684b647f1a6ab250274 # v1.46.0

0 commit comments

Comments
 (0)