Skip to content

Commit 07bd058

Browse files
committed
chore: update from changes in other projects
1 parent bc15855 commit 07bd058

File tree

8 files changed

+183
-142
lines changed

8 files changed

+183
-142
lines changed

.github/workflows/audit-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99

1010
jobs:
1111
audit-check:
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-24.04
1313
permissions:
1414
checks: write
1515
issues: write

.github/workflows/ci.yml

Lines changed: 40 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@ on:
66
workflow_dispatch:
77

88
env:
9+
CARGO_TERM_COLOR: always
910
CI: 1
1011

1112
jobs:
1213
clippy:
13-
name: Clippy validation${{ matrix.all-features && ' with all features' || '' }}
14-
strategy:
15-
fail-fast: false
16-
matrix:
17-
all-features: [ false ] # TODO if your crate has optional features, add 'true' to this list
18-
runs-on: ubuntu-latest
14+
name: Clippy validation
15+
runs-on: ubuntu-24.04
1916
steps:
2017
- name: Checkout code
2118
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -30,18 +27,19 @@ jobs:
3027
- name: Rust Cache
3128
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
3229
with:
33-
prefix-key: v1-rust
34-
key: all-features-${{ matrix.all-features }}
30+
prefix-key: v2-rust
3531
cache-on-failure: true
3632

3733
- name: Run clippy
3834
uses: clechasseur/rs-clippy-check@23f6dcf86d7e4e0d98b000bba0bb81ac587c44aa # v4.0.2
3935
with:
40-
args: --workspace --all-targets ${{ matrix.all-features && '--all-features' || '' }} -- -D warnings
36+
args: --workspace --all-targets --feature-powerset -- -D warnings
37+
tool: cargo-hack
38+
cache-key: v1-clippy
4139

4240
fmt:
4341
name: Rustfmt check
44-
runs-on: ubuntu-latest
42+
runs-on: ubuntu-24.04
4543
steps:
4644
- name: Checkout code
4745
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -59,14 +57,13 @@ jobs:
5957
args: --all
6058

6159
msrv-check:
62-
name: MSRV check for Rust ${{ matrix.toolchain }} on ${{ matrix.os }}${{ matrix.all-features && ' with all features' || '' }}
60+
name: MSRV check for Rust ${{ matrix.toolchain }} on ${{ matrix.os }}
6361
strategy:
6462
fail-fast: false
6563
matrix:
64+
os: [ ubuntu-24.04, macos-14, windows-2022 ]
6665
toolchain: [ 1.60.0 ] # TODO: change for your minimum supported Rust version
67-
os: [ ubuntu, macos, windows ]
68-
all-features: [ false ] # TODO if your crate has optional features, add 'true' to this list
69-
runs-on: ${{ matrix.os }}-latest
66+
runs-on: ${{ matrix.os }}
7067
steps:
7168
- name: Checkout code
7269
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -80,29 +77,28 @@ jobs:
8077
- name: Rust Cache
8178
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
8279
with:
83-
prefix-key: v7-rust
84-
key: all-features-${{ matrix.all-features }}-msrv-pins-files-${{ hashFiles('**/msrv-pins.toml') }}
80+
prefix-key: v10-rust
81+
key: msrv-pins-files-${{ hashFiles('**/msrv-pins.toml') }}
8582
cache-on-failure: true
8683

8784
- name: Install required tools
8885
uses: taiki-e/install-action@f1390fd0d8205ae79e5e57b1d1e300dceeb4163e # v2.49.44
8986
with:
90-
tool: just,cargo-hack,cargo-minimal-versions,cargo-msrv,cargo-msrv-prep
87+
tool: just,cargo-hack,cargo-minimal-versions,cargo-msrv-prep
9188
env:
9289
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9390

9491
- name: Run checks using cargo-minimal-versions
95-
run: just all_features=${{ matrix.all-features }} check-minimal
92+
run: just toolchain=${{ matrix.toolchain }} check-minimal
9693

9794
build:
98-
name: Build for Rust ${{ matrix.toolchain }}${{ matrix.experimental && ' (experimental)' || '' }} on ${{ matrix.os }}${{ matrix.ignore-lock && ' without Cargo.lock' || '' }}${{ matrix.all-features && ' with all features' || '' }}
95+
name: Build for Rust ${{ matrix.toolchain }}${{ matrix.experimental && ' (experimental)' || '' }} on ${{ matrix.os }}${{ matrix.ignore-lock && ' without Cargo.lock' || '' }}
9996
strategy:
10097
fail-fast: false
10198
matrix:
10299
toolchain: [ 1.68.2, stable, beta, nightly ] # TODO: change 1.68.2 for your minimum supported Rust version
103-
os: [ ubuntu, macos, windows ]
100+
os: [ ubuntu-24.04, macos-14, windows-2022 ]
104101
ignore-lock: [ false, true ]
105-
all-features: [ false ] # TODO if your crate has optional features, add 'true' to this list
106102
include:
107103
- experimental: false
108104
- toolchain: beta
@@ -112,7 +108,7 @@ jobs:
112108
exclude:
113109
- toolchain: 1.68.2 # TODO: change this version to match the minimum supported Rust version specified above
114110
ignore-lock: true
115-
runs-on: ${{ matrix.os }}-latest
111+
runs-on: ${{ matrix.os }}
116112
continue-on-error: ${{ matrix.experimental }}
117113
steps:
118114
- name: Checkout code
@@ -132,71 +128,60 @@ jobs:
132128
if: ${{ !matrix.experimental }}
133129
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
134130
with:
135-
prefix-key: v2-rust
136-
key: ignore-lock-${{ matrix.ignore-lock }}-all-features-${{ matrix.all-features }}
131+
prefix-key: v3-rust
132+
key: ignore-lock-${{ matrix.ignore-lock }}
137133
cache-on-failure: true
138134

139-
- name: Install just
135+
- name: Install required tools
140136
uses: taiki-e/install-action@f1390fd0d8205ae79e5e57b1d1e300dceeb4163e # v2.49.44
141137
with:
142-
tool: just
138+
tool: just,cargo-hack
143139
env:
144140
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
145141

146-
- name: Run checks
147-
run: just all_features=${{ matrix.all-features }} check
142+
- name: Run checks on feature powerset
143+
run: just check-powerset
148144

149145
- name: Run tests
150-
run: just all_features=${{ matrix.all-features }} test
151-
152-
tarpaulin:
153-
# Note: there seems to be an issue in `cargo-tarpaulin` when using Rust 1.75.0 or later - it reports some missing line coverage.
154-
# I've entered an issue: https://github.com/xd009642/tarpaulin/issues/1438
155-
# In the meantime, let's pin the Rust version used for code coverage to 1.74.1 until we know what's happening.
156-
name: Code coverage
157-
runs-on: ubuntu-latest
146+
run: just test
147+
148+
llvm-cov:
149+
name: Code coverage with llvm-cov
150+
runs-on: ubuntu-24.04
158151
steps:
159152
- name: Checkout code
160153
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
161154

162-
- name: Install Rust
155+
- name: Install Rust nightly
163156
uses: actions-rust-lang/setup-rust-toolchain@9399c7bb15d4c7d47b27263d024f0a4978346ba4 # v1.11.0
164157
with:
165-
toolchain: 1.74.1
158+
toolchain: nightly
166159
cache: false
167160

168-
- name: Rust Cache
169-
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
170-
with:
171-
prefix-key: v2-rust
172-
cache-targets: false
173-
cache-on-failure: true
174-
175-
- name: Install cargo-tarpaulin
161+
- name: Install required tools
176162
uses: taiki-e/install-action@f1390fd0d8205ae79e5e57b1d1e300dceeb4163e # v2.49.44
177163
with:
178-
tool: cargo-tarpaulin
164+
tool: just,cargo-llvm-cov
179165
env:
180166
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
181167

182-
- name: Run cargo-tarpaulin
183-
uses: clechasseur/rs-cargo@319e211e9459c5e531afb6d157296765b441572e # v3.0.3
184-
with:
185-
command: tarpaulin
168+
- name: Run cargo-llvm-cov
169+
run: just llvm-cov
186170

187171
- name: Upload code coverage results to codecov.io
188172
uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
189173
with:
190174
token: ${{ secrets.CODECOV_TOKEN }}
175+
files: codecov.json
191176
fail_ci_if_error: true
192177

193178
- name: Archive code coverage results
194179
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
195180
with:
196-
name: code-coverage-report
181+
name: llvm-cov-code-coverage-report
197182
path: |
198-
cobertura.xml
199-
tarpaulin-report.html
183+
codecov.json
184+
target/llvm-cov/html/
200185
201186
doc:
202187
name: Rustdoc check for Rust ${{ matrix.toolchain }}${{ matrix.experimental && ' (experimental)' || '' }}
@@ -208,7 +193,7 @@ jobs:
208193
- experimental: false
209194
- toolchain: nightly
210195
experimental: true
211-
runs-on: ubuntu-latest
196+
runs-on: ubuntu-24.04
212197
continue-on-error: ${{ matrix.experimental }}
213198
steps:
214199
- name: Checkout code
@@ -237,29 +222,3 @@ jobs:
237222

238223
- name: Generate doc using rustdoc
239224
run: just doc
240-
241-
publish-dry-run:
242-
name: Publish dry-run
243-
runs-on: ubuntu-latest
244-
steps:
245-
- name: Checkout code
246-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
247-
248-
- name: Install Rust
249-
uses: actions-rust-lang/setup-rust-toolchain@9399c7bb15d4c7d47b27263d024f0a4978346ba4 # v1.11.0
250-
with:
251-
toolchain: stable
252-
cache: false
253-
254-
- name: Rust Cache
255-
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
256-
with:
257-
prefix-key: v2-rust
258-
cache-targets: false
259-
cache-on-failure: true
260-
261-
- name: Perform publish dry-run
262-
uses: clechasseur/rs-cargo@319e211e9459c5e531afb6d157296765b441572e # v3.0.3
263-
with:
264-
command: publish
265-
args: --dry-run

.github/workflows/publish.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish to crates.io
2+
3+
on:
4+
# TODO re-enable once project is set up properly if you have crates to publish, otherwise remove the workflow
5+
#push:
6+
# tags:
7+
# - v[0-9]+.[0-9]+.[0-9]+
8+
workflow_dispatch:
9+
10+
jobs:
11+
publish:
12+
env:
13+
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
14+
runs-on: ubuntu-24.04
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
19+
- name: Install Rust
20+
uses: actions-rust-lang/setup-rust-toolchain@9399c7bb15d4c7d47b27263d024f0a4978346ba4 # v1.11.0
21+
with:
22+
toolchain: stable
23+
cache: false
24+
25+
- name: Rust Cache
26+
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
27+
with:
28+
cache-on-failure: true
29+
30+
- name: Publish package
31+
uses: clechasseur/rs-cargo@319e211e9459c5e531afb6d157296765b441572e # v3.0.3
32+
with:
33+
command: publish

.gitignore

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ target*/
88
# These are backup files generated by rustfmt
99
**/*.rs.bk
1010

11-
# Files that exist while we run `cargo minimal-versions`/`cargo msrv`
12-
*.msrv-prep*.bak
13-
1411
# MSVC Windows builds of rustc generate these, which store debugging information
1512
*.pdb
1613

@@ -21,7 +18,12 @@ target*/
2118
# docker-compose.override.yml is meant to be local-only
2219
docker-compose.override.yml
2320

24-
# Profiling files generated by cargo-tarpaulin
21+
# Profiling files generated by cargo-tarpaulin and cargo-llvm-cov
2522
*.profraw
2623
cobertura.xml
2724
tarpaulin-report.*
25+
cov.json
26+
codecov.json
27+
28+
# Local environment overrides
29+
.env

DEVELOPMENT.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ rustup update
1313

1414
### Rust nightly
1515

16-
In order to run `rustfmt`, you will need a Nightly Rust toolset. If you do not have one installed, you can install one via `rustup` by running
16+
Certain tools require a Nightly Rust toolset. If you do not have one installed, you can install one via `rustup` by running
1717

1818
```bash
1919
rustup toolchain install nightly
2020
```
2121

22-
If you already have one installed but it was too old, it was probably updated earlier when you ran `rustup update` 😉
22+
If you already have one installed, but it was too old, it was probably updated earlier when you ran `rustup update` 😉
2323

2424
### Just
2525

@@ -28,7 +28,7 @@ If you already have one installed but it was too old, it was probably updated ea
2828
This project includes a [justfile](justfile) that makes it easier to run the various tools used for development. To install `just` via `cargo`, simply run
2929

3030
```bash
31-
cargo install just
31+
cargo install just --locked
3232
```
3333

3434
If you have [cargo-binstall](https://github.com/cargo-bins/cargo-binstall), it'll probably be faster to use it instead:
@@ -39,17 +39,17 @@ cargo binstall just
3939

4040
You can also install it via various [methods](https://github.com/casey/just#packages).
4141

42-
### Tarpaulin
42+
### Llvm-cov
4343

44-
If you want to run tests with coverage locally, you'll need to install [`cargo-tarpaulin`](https://github.com/xd009642/tarpaulin), a code coverage tool for Rust. You can install it via `cargo`:
44+
If you want to run tests with coverage locally, you'll need to install [`cargo-llvm-cov`](https://github.com/taiki-e/cargo-llvm-cov), a code coverage tool for Rust. You can install it via `cargo`:
4545

4646
```bash
47-
cargo install cargo-tarpaulin
47+
cargo install cargo-llvm-cov --locked
4848
```
4949
You can also install it via [cargo-binstall](https://github.com/cargo-bins/cargo-binstall):
5050

5151
```bash
52-
cargo binstall cargo-tarpaulin
52+
cargo binstall cargo-llvm-cov
5353
```
5454

5555
## Development
@@ -76,10 +76,10 @@ Required checks will not pass if either of those report issues.
7676

7777
### Code coverage
7878

79-
This project's [code coverage settings](codecov.yml) are pretty stringent and require **100% coverage**. To validate this locally, you can run
79+
This project's [code coverage settings](codecov.yml) are pretty stringent. To validate this locally, you can run
8080

8181
```bash
82-
just tarpaulin
82+
just llvm-cov
8383
```
8484

8585
Make sure coverage is at the required level before submitting a PR.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Charles Lechasseur
3+
Copyright (c) 2025 Charles Lechasseur
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

codecov.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
coverage:
2+
range: "80...95"
23
status:
34
project:
45
default:
5-
target: 100%
6-
threshold: 1%
6+
threshold: 100
7+
patch:
8+
default:
9+
threshold: 100

0 commit comments

Comments
 (0)