Skip to content

Commit 52fa45e

Browse files
authored
Merge pull request #576 from epage/template
chore: Update from _rust template
2 parents be5b50b + 11e8444 commit 52fa45e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+822
-624
lines changed

.clippy.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
msrv = "1.83.0" # MSRV
2-
warn-on-all-wildcard-imports = true
1+
allow-print-in-tests = true
32
allow-expect-in-tests = true
43
allow-unwrap-in-tests = true
54
allow-dbg-in-tests = true

.github/renovate.json5

+10-8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
'before 5am on the first day of the month',
44
],
55
semanticCommits: 'enabled',
6+
commitMessageLowerCase: 'never',
67
configMigration: true,
78
dependencyDashboard: true,
89
customManagers: [
@@ -17,29 +18,28 @@
1718
'^\\.github/workflows/rust-next.yml$',
1819
],
1920
matchStrings: [
20-
'MSRV.*?(?<currentValue>\\d+\\.\\d+(\\.\\d+)?)',
21-
'(?<currentValue>\\d+\\.\\d+(\\.\\d+)?).*?MSRV',
21+
'STABLE.*?(?<currentValue>\\d+\\.\\d+(\\.\\d+)?)',
22+
'(?<currentValue>\\d+\\.\\d+(\\.\\d+)?).*?STABLE',
2223
],
23-
depNameTemplate: 'rust',
24+
depNameTemplate: 'STABLE',
2425
packageNameTemplate: 'rust-lang/rust',
2526
datasourceTemplate: 'github-releases',
2627
},
2728
],
2829
packageRules: [
2930
{
30-
commitMessageTopic: 'MSRV',
31+
commitMessageTopic: 'Rust Stable',
3132
matchManagers: [
3233
'custom.regex',
3334
],
34-
matchPackageNames: [
35-
'rust',
35+
matchDepNames: [
36+
'STABLE',
3637
],
37-
minimumReleaseAge: '126 days', // 3 releases * 6 weeks per release * 7 days per week
38-
internalChecksFilter: 'strict',
3938
extractVersion: '^(?<version>\\d+\\.\\d+)', // Drop the patch version
4039
schedule: [
4140
'* * * * *',
4241
],
42+
automerge: true,
4343
},
4444
// Goals:
4545
// - Keep version reqs low, ignoring compatible normal/build dependencies
@@ -72,6 +72,7 @@
7272
matchCurrentVersion: '>=1.0.0',
7373
matchUpdateTypes: [
7474
'minor',
75+
'patch',
7576
],
7677
enabled: false,
7778
},
@@ -99,6 +100,7 @@
99100
matchCurrentVersion: '>=1.0.0',
100101
matchUpdateTypes: [
101102
'minor',
103+
'patch',
102104
],
103105
automerge: true,
104106
groupName: 'compatible (dev)',

.github/settings.yml

+15-11
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,18 @@ labels:
5151
color: '#c2e0c6'
5252
description: Base ruby implementation
5353

54-
branches:
55-
- name: master
56-
protection:
57-
required_pull_request_reviews: null
58-
required_conversation_resolution: true
59-
required_status_checks:
60-
# Required. Require branches to be up to date before merging.
61-
strict: false
62-
contexts: ["CI", "Lint Commits", "Spell Check with Typos"]
63-
enforce_admins: false
64-
restrictions: null
54+
# This serves more as documentation.
55+
# Branch protection API was replaced by rulesets but settings isn't updated.
56+
# See https://github.com/repository-settings/app/issues/825
57+
#
58+
# branches:
59+
# - name: master
60+
# protection:
61+
# required_pull_request_reviews: null
62+
# required_conversation_resolution: true
63+
# required_status_checks:
64+
# # Required. Require branches to be up to date before merging.
65+
# strict: false
66+
# contexts: ["CI", "Lint Commits", "Spell Check with Typos"]
67+
# enforce_admins: false
68+
# restrictions: null

.github/workflows/audit.yml

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ env:
1717
CARGO_TERM_COLOR: always
1818
CLICOLOR: 1
1919

20+
concurrency:
21+
group: "${{ github.workflow }}-${{ github.ref }}"
22+
cancel-in-progress: true
23+
2024
jobs:
2125
security_audit:
2226
permissions:

.github/workflows/ci.yml

+55-14
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,22 @@ env:
1414
CARGO_TERM_COLOR: always
1515
CLICOLOR: 1
1616

17+
concurrency:
18+
group: "${{ github.workflow }}-${{ github.ref }}"
19+
cancel-in-progress: true
20+
1721
jobs:
1822
ci:
1923
permissions:
2024
contents: none
2125
name: CI
22-
needs: [test, msrv, docs, rustfmt, clippy]
26+
needs: [test, msrv, lockfile, docs, rustfmt, clippy, minimal-versions]
2327
runs-on: ubuntu-latest
28+
if: "always()"
2429
steps:
25-
- name: Done
26-
run: exit 0
30+
- name: Failed
31+
run: exit 1
32+
if: "contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped')"
2733
test:
2834
name: Test
2935
strategy:
@@ -49,22 +55,40 @@ jobs:
4955
- name: No-default features
5056
run: cargo test --workspace --no-default-features
5157
msrv:
52-
name: "Check MSRV: 1.83.0"
58+
name: "Check MSRV"
5359
runs-on: ubuntu-latest
5460
steps:
5561
- name: Checkout repository
5662
uses: actions/checkout@v4
5763
- name: Install Rust
5864
uses: dtolnay/rust-toolchain@stable
5965
with:
60-
toolchain: "1.83.0" # MSRV
66+
toolchain: stable
6167
- uses: Swatinem/rust-cache@v2
6268
- name: Default features
6369
run: cargo check --workspace --all-targets
6470
- name: All features
6571
run: cargo check --workspace --all-targets --all-features
6672
- name: No-default features
6773
run: cargo check --workspace --all-targets --no-default-features
74+
minimal-versions:
75+
name: Minimal versions
76+
runs-on: ubuntu-latest
77+
steps:
78+
- name: Checkout repository
79+
uses: actions/checkout@v4
80+
- name: Install stable Rust
81+
uses: dtolnay/rust-toolchain@stable
82+
with:
83+
toolchain: stable
84+
- name: Install nightly Rust
85+
uses: dtolnay/rust-toolchain@stable
86+
with:
87+
toolchain: nightly
88+
- name: Downgrade dependencies to minimal versions
89+
run: cargo +nightly generate-lockfile -Z minimal-versions
90+
- name: Compile with minimal versions
91+
run: cargo +stable check --workspace --all-features --locked
6892
lockfile:
6993
runs-on: ubuntu-latest
7094
steps:
@@ -76,7 +100,7 @@ jobs:
76100
toolchain: stable
77101
- uses: Swatinem/rust-cache@v2
78102
- name: "Is lockfile updated?"
79-
run: cargo fetch --locked
103+
run: cargo update --workspace --locked
80104
docs:
81105
name: Docs
82106
runs-on: ubuntu-latest
@@ -86,7 +110,7 @@ jobs:
86110
- name: Install Rust
87111
uses: dtolnay/rust-toolchain@stable
88112
with:
89-
toolchain: stable
113+
toolchain: "1.84" # STABLE
90114
- uses: Swatinem/rust-cache@v2
91115
- name: Check documentation
92116
env:
@@ -101,9 +125,7 @@ jobs:
101125
- name: Install Rust
102126
uses: dtolnay/rust-toolchain@stable
103127
with:
104-
# Not MSRV because its harder to jump between versions and people are
105-
# more likely to have stable
106-
toolchain: stable
128+
toolchain: "1.84" # STABLE
107129
components: rustfmt
108130
- uses: Swatinem/rust-cache@v2
109131
- name: Check formatting
@@ -119,16 +141,16 @@ jobs:
119141
- name: Install Rust
120142
uses: dtolnay/rust-toolchain@stable
121143
with:
122-
toolchain: "1.83.0" # MSRV
144+
toolchain: "1.84" # STABLE
123145
components: clippy
124146
- uses: Swatinem/rust-cache@v2
125147
- name: Install SARIF tools
126-
run: cargo install clippy-sarif --version 0.3.4 --locked # Held back due to msrv
148+
run: cargo install clippy-sarif --locked
127149
- name: Install SARIF tools
128-
run: cargo install sarif-fmt --version 0.3.4 --locked # Held back due to msrv
150+
run: cargo install sarif-fmt --locked
129151
- name: Check
130152
run: >
131-
cargo clippy --workspace --all-features --all-targets --message-format=json -- -D warnings --allow deprecated
153+
cargo clippy --workspace --all-features --all-targets --message-format=json
132154
| clippy-sarif
133155
| tee clippy-results.sarif
134156
| sarif-fmt
@@ -140,3 +162,22 @@ jobs:
140162
wait-for-processing: true
141163
- name: Report status
142164
run: cargo clippy --workspace --all-features --all-targets -- -D warnings --allow deprecated
165+
coverage:
166+
name: Coverage
167+
runs-on: ubuntu-latest
168+
steps:
169+
- name: Checkout repository
170+
uses: actions/checkout@v4
171+
- name: Install Rust
172+
uses: dtolnay/rust-toolchain@stable
173+
with:
174+
toolchain: stable
175+
- uses: Swatinem/rust-cache@v2
176+
- name: Install cargo-tarpaulin
177+
run: cargo install cargo-tarpaulin
178+
- name: Gather coverage
179+
run: cargo tarpaulin --output-dir coverage --out lcov
180+
- name: Publish to Coveralls
181+
uses: coverallsapp/github-action@master
182+
with:
183+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/committed.yml

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ env:
1111
CARGO_TERM_COLOR: always
1212
CLICOLOR: 1
1313

14+
concurrency:
15+
group: "${{ github.workflow }}-${{ github.ref }}"
16+
cancel-in-progress: true
17+
1418
jobs:
1519
committed:
1620
name: Lint Commits

.github/workflows/pre-commit.yml

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ env:
1212
CARGO_TERM_COLOR: always
1313
CLICOLOR: 1
1414

15+
concurrency:
16+
group: "${{ github.workflow }}-${{ github.ref }}"
17+
cancel-in-progress: true
18+
1519
jobs:
1620
pre-commit:
1721
permissions:
@@ -20,4 +24,6 @@ jobs:
2024
steps:
2125
- uses: actions/checkout@v4
2226
- uses: actions/setup-python@v5
27+
with:
28+
python-version: '3.x'
2329
- uses: pre-commit/action@v3.0.1

.github/workflows/rust-next.yml

+15-13
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ env:
1212
CARGO_TERM_COLOR: always
1313
CLICOLOR: 1
1414

15+
concurrency:
16+
group: "${{ github.workflow }}-${{ github.ref }}"
17+
cancel-in-progress: true
18+
1519
jobs:
1620
test:
1721
name: Test
@@ -32,12 +36,11 @@ jobs:
3236
with:
3337
toolchain: ${{ matrix.rust }}
3438
- uses: Swatinem/rust-cache@v2
35-
- name: Default features
36-
run: cargo test --workspace
37-
- name: All features
38-
run: cargo test --workspace --all-features
39-
- name: No-default features
40-
run: cargo test --workspace --no-default-features
39+
- uses: taiki-e/install-action@cargo-hack
40+
- name: Build
41+
run: cargo test --workspace --no-run
42+
- name: Test
43+
run: cargo hack test --feature-powerset --workspace
4144
latest:
4245
name: "Check latest dependencies"
4346
runs-on: ubuntu-latest
@@ -49,11 +52,10 @@ jobs:
4952
with:
5053
toolchain: stable
5154
- uses: Swatinem/rust-cache@v2
52-
- name: Update dependencues
55+
- uses: taiki-e/install-action@cargo-hack
56+
- name: Update dependencies
5357
run: cargo update
54-
- name: Default features
55-
run: cargo test --workspace --all-targets
56-
- name: All features
57-
run: cargo test --workspace --all-targets --all-features
58-
- name: No-default features
59-
run: cargo test --workspace --all-targets --no-default-features
58+
- name: Build
59+
run: cargo test --workspace --no-run
60+
- name: Test
61+
run: cargo hack test --feature-powerset --workspace

.github/workflows/spelling.yml

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ env:
1010
CARGO_TERM_COLOR: always
1111
CLICOLOR: 1
1212

13+
concurrency:
14+
group: "${{ github.workflow }}-${{ github.ref }}"
15+
cancel-in-progress: true
16+
1317
jobs:
1418
spelling:
1519
name: Spell Check with Typos

0 commit comments

Comments
 (0)