Skip to content

Commit c07666d

Browse files
authored
Merge pull request #34 from epage/template
chore: Update from _rust/main template
2 parents 4045f13 + 874a654 commit c07666d

File tree

15 files changed

+278
-108
lines changed

15 files changed

+278
-108
lines changed

.clippy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
msrv = "1.70.0" # MSRV
21
warn-on-all-wildcard-imports = true
2+
allow-print-in-tests = true
33
allow-expect-in-tests = true
44
allow-unwrap-in-tests = true
55
allow-dbg-in-tests = true

.github/renovate.json5

Lines changed: 36 additions & 2 deletions
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: [
@@ -20,7 +21,25 @@
2021
'MSRV.*?(?<currentValue>\\d+\\.\\d+(\\.\\d+)?)',
2122
'(?<currentValue>\\d+\\.\\d+(\\.\\d+)?).*?MSRV',
2223
],
23-
depNameTemplate: 'rust',
24+
depNameTemplate: 'MSRV',
25+
packageNameTemplate: 'rust-lang/rust',
26+
datasourceTemplate: 'github-releases',
27+
},
28+
{
29+
customType: 'regex',
30+
fileMatch: [
31+
'^rust-toolchain\\.toml$',
32+
'Cargo.toml$',
33+
'clippy.toml$',
34+
'\\.clippy.toml$',
35+
'^\\.github/workflows/ci.yml$',
36+
'^\\.github/workflows/rust-next.yml$',
37+
],
38+
matchStrings: [
39+
'STABLE.*?(?<currentValue>\\d+\\.\\d+(\\.\\d+)?)',
40+
'(?<currentValue>\\d+\\.\\d+(\\.\\d+)?).*?STABLE',
41+
],
42+
depNameTemplate: 'STABLE',
2443
packageNameTemplate: 'rust-lang/rust',
2544
datasourceTemplate: 'github-releases',
2645
},
@@ -32,7 +51,7 @@
3251
'custom.regex',
3352
],
3453
matchPackageNames: [
35-
'rust',
54+
'MSRV',
3655
],
3756
minimumReleaseAge: '252 days', // 6 releases * 6 weeks per release * 7 days per week
3857
internalChecksFilter: 'strict',
@@ -41,6 +60,19 @@
4160
'* * * * *',
4261
],
4362
},
63+
{
64+
commitMessageTopic: 'Rust Stable',
65+
matchManagers: [
66+
'custom.regex',
67+
],
68+
matchPackageNames: [
69+
'STABLE',
70+
],
71+
extractVersion: '^(?<version>\\d+\\.\\d+)', // Drop the patch version
72+
schedule: [
73+
'* * * * *',
74+
],
75+
},
4476
{
4577
matchManagers: [
4678
'cargo',
@@ -87,6 +119,7 @@
87119
matchCurrentVersion: '>=1.0.0',
88120
matchUpdateTypes: [
89121
'minor',
122+
'patch',
90123
],
91124
enabled: false,
92125
},
@@ -114,6 +147,7 @@
114147
matchCurrentVersion: '>=1.0.0',
115148
matchUpdateTypes: [
116149
'minor',
150+
'patch',
117151
],
118152
automerge: true,
119153
groupName: 'compatible (dev)',

.github/settings.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,18 @@ labels:
4242
color: '#c2e0c6'
4343
description: "Help wanted!"
4444

45-
branches:
46-
- name: main
47-
protection:
48-
required_pull_request_reviews: null
49-
required_conversation_resolution: true
50-
required_status_checks:
51-
# Required. Require branches to be up to date before merging.
52-
strict: false
53-
contexts: ["CI", "Lint Commits", "Spell Check with Typos"]
54-
enforce_admins: false
55-
restrictions: null
45+
# This serves more as documentation.
46+
# Branch protection API was replaced by rulesets but settings isn't updated.
47+
# See https://github.com/repository-settings/app/issues/825
48+
#
49+
# branches:
50+
# - name: main
51+
# protection:
52+
# required_pull_request_reviews: null
53+
# required_conversation_resolution: true
54+
# required_status_checks:
55+
# # Required. Require branches to be up to date before merging.
56+
# strict: false
57+
# contexts: ["CI", "Spell Check with Typos"]
58+
# enforce_admins: false
59+
# restrictions: null

.github/workflows/audit.yml

Lines changed: 4 additions & 0 deletions
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

Lines changed: 43 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,27 @@ 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]
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:
3036
matrix:
31-
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
37+
os: ["ubuntu-latest", "windows-latest", "macos-14"]
3238
rust: ["stable"]
3339
continue-on-error: ${{ matrix.rust != 'stable' }}
3440
runs-on: ${{ matrix.os }}
@@ -40,31 +46,25 @@ jobs:
4046
with:
4147
toolchain: ${{ matrix.rust }}
4248
- uses: Swatinem/rust-cache@v2
49+
- uses: taiki-e/install-action@cargo-hack
4350
- name: Build
44-
run: cargo test --no-run --workspace --all-features
45-
- name: Default features
46-
run: cargo test --workspace
47-
- name: All features
48-
run: cargo test --workspace --all-features
49-
- name: No-default features
50-
run: cargo test --workspace --no-default-features
51+
run: cargo test --workspace --no-run
52+
- name: Test
53+
run: cargo hack test --feature-powerset --workspace
5154
msrv:
52-
name: "Check MSRV: 1.70.0"
55+
name: "Check MSRV"
5356
runs-on: ubuntu-latest
5457
steps:
5558
- name: Checkout repository
5659
uses: actions/checkout@v4
5760
- name: Install Rust
5861
uses: dtolnay/rust-toolchain@stable
5962
with:
60-
toolchain: "1.70" # MSRV
63+
toolchain: stable
6164
- uses: Swatinem/rust-cache@v2
65+
- uses: taiki-e/install-action@cargo-hack
6266
- name: Default features
63-
run: cargo check --workspace --all-targets
64-
- name: All features
65-
run: cargo check --workspace --all-targets --all-features
66-
- name: No-default features
67-
run: cargo check --workspace --all-targets --no-default-features
67+
run: cargo hack check --feature-powerset --locked --rust-version --ignore-private --workspace --all-targets
6868
lockfile:
6969
runs-on: ubuntu-latest
7070
steps:
@@ -76,7 +76,7 @@ jobs:
7676
toolchain: stable
7777
- uses: Swatinem/rust-cache@v2
7878
- name: "Is lockfile updated?"
79-
run: cargo fetch --locked
79+
run: cargo update --workspace --locked
8080
docs:
8181
name: Docs
8282
runs-on: ubuntu-latest
@@ -86,7 +86,7 @@ jobs:
8686
- name: Install Rust
8787
uses: dtolnay/rust-toolchain@stable
8888
with:
89-
toolchain: stable
89+
toolchain: "1.76" # STABLE
9090
- uses: Swatinem/rust-cache@v2
9191
- name: Check documentation
9292
env:
@@ -101,9 +101,7 @@ jobs:
101101
- name: Install Rust
102102
uses: dtolnay/rust-toolchain@stable
103103
with:
104-
# Not MSRV because its harder to jump between versions and people are
105-
# more likely to have stable
106-
toolchain: stable
104+
toolchain: "1.76" # STABLE
107105
components: rustfmt
108106
- uses: Swatinem/rust-cache@v2
109107
- name: Check formatting
@@ -119,13 +117,13 @@ jobs:
119117
- name: Install Rust
120118
uses: dtolnay/rust-toolchain@stable
121119
with:
122-
toolchain: "1.70" # MSRV
120+
toolchain: "1.76" # STABLE
123121
components: clippy
124122
- uses: Swatinem/rust-cache@v2
125123
- name: Install SARIF tools
126-
run: cargo install clippy-sarif --version 0.3.4 --locked # Held back due to msrv
124+
run: cargo install clippy-sarif --locked
127125
- name: Install SARIF tools
128-
run: cargo install sarif-fmt --version 0.3.4 --locked # Held back due to msrv
126+
run: cargo install sarif-fmt --locked
129127
- name: Check
130128
run: >
131129
cargo clippy --workspace --all-features --all-targets --message-format=json -- -D warnings --allow deprecated
@@ -140,3 +138,22 @@ jobs:
140138
wait-for-processing: true
141139
- name: Report status
142140
run: cargo clippy --workspace --all-features --all-targets -- -D warnings --allow deprecated
141+
coverage:
142+
name: Coverage
143+
runs-on: ubuntu-latest
144+
steps:
145+
- name: Checkout repository
146+
uses: actions/checkout@v4
147+
- name: Install Rust
148+
uses: dtolnay/rust-toolchain@stable
149+
with:
150+
toolchain: stable
151+
- uses: Swatinem/rust-cache@v2
152+
- name: Install cargo-tarpaulin
153+
run: cargo install cargo-tarpaulin
154+
- name: Gather coverage
155+
run: cargo tarpaulin --output-dir coverage --out lcov
156+
- name: Publish to Coveralls
157+
uses: coverallsapp/github-action@master
158+
with:
159+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/committed.yml

Lines changed: 4 additions & 0 deletions
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

Lines changed: 4 additions & 0 deletions
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:

.github/workflows/rust-next.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@ 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
1822
strategy:
1923
matrix:
20-
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
24+
os: ["ubuntu-latest", "windows-latest", "macos-latest", "macos-14"]
2125
rust: ["stable", "beta"]
2226
include:
2327
- os: ubuntu-latest
@@ -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
55+
- uses: taiki-e/install-action@cargo-hack
5256
- name: Update dependencues
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

Lines changed: 4 additions & 0 deletions
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)