Skip to content

Commit 2bedcd5

Browse files
committed
Enhances Rust CI workflow efficiency and features
Adds concurrency controls to cancel redundant runs and disable fail-fast for comprehensive matrix testing. Switches to cargo-nextest for faster test execution and adds documentation tests. Updates minimum supported Rust version and simplifies MSRV checks. Improves code coverage setup with LLVM tools and removes unused benchmark job.
1 parent abb81b6 commit 2bedcd5

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

.github/workflows/rust.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ name: Rust CI
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches: ["main"]
66
pull_request:
7-
branches: [ "main" ]
7+
branches: ["main"]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
812

913
env:
1014
CARGO_TERM_COLOR: always
@@ -36,19 +40,22 @@ jobs:
3640
test:
3741
name: Test Suite
3842
strategy:
43+
fail-fast: false
3944
matrix:
40-
rust: [ stable, beta, nightly ]
41-
os: [ ubuntu-latest, windows-latest, macos-latest ]
45+
rust: [stable, beta, nightly]
46+
os: [ubuntu-latest, windows-latest, macos-latest]
4247
runs-on: ${{ matrix.os }}
4348
steps:
4449
- uses: actions/checkout@v6
4550
- uses: dtolnay/rust-toolchain@master
4651
with:
4752
toolchain: ${{ matrix.rust }}
4853
- uses: Swatinem/rust-cache@v2
54+
- uses: taiki-e/install-action@nextest
4955
- run: cargo build --workspace
50-
- run: cargo test --workspace
51-
- run: cargo test -p birefnet --features train
56+
- run: cargo nextest run --workspace
57+
- run: cargo nextest run -p birefnet --features train
58+
- run: cargo test --workspace --doc
5259

5360
docs:
5461
name: Documentation
@@ -80,30 +87,23 @@ jobs:
8087
- uses: actions/checkout@v6
8188
- uses: dtolnay/rust-toolchain@master
8289
with:
83-
toolchain: 1.85.1
90+
toolchain: 1.89.0
8491
- uses: Swatinem/rust-cache@v2
85-
- run: cargo build --workspace
86-
- run: cargo test --workspace
92+
- run: cargo check --workspace
8793

8894
coverage:
8995
name: Code Coverage
9096
runs-on: ubuntu-latest
9197
steps:
9298
- uses: actions/checkout@v6
9399
- uses: dtolnay/rust-toolchain@stable
100+
with:
101+
components: llvm-tools-preview
94102
- uses: Swatinem/rust-cache@v2
95103
- uses: taiki-e/install-action@cargo-llvm-cov
96104
- run: cargo llvm-cov --workspace --lcov --output-path lcov.info
97105
- uses: codecov/codecov-action@v5
98106
with:
99107
files: lcov.info
100108
fail_ci_if_error: false
101-
102-
benchmark:
103-
name: Benchmarks
104-
runs-on: ubuntu-latest
105-
steps:
106-
- uses: actions/checkout@v6
107-
- uses: dtolnay/rust-toolchain@stable
108-
- uses: Swatinem/rust-cache@v2
109-
- run: cargo bench --workspace --no-run
109+
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)