1414 CARGO_TERM_COLOR : always
1515 CLICOLOR : 1
1616
17+ concurrency :
18+ group : " ${{ github.workflow }}-${{ github.ref }}"
19+ cancel-in-progress : true
20+
1721jobs :
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 :
@@ -40,31 +46,43 @@ 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.76 "
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.76 " # 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
68+ minimal-versions :
69+ name : Minimal versions
70+ runs-on : ubuntu-latest
71+ steps :
72+ - name : Checkout repository
73+ uses : actions/checkout@v4
74+ - name : Install stable Rust
75+ uses : dtolnay/rust-toolchain@stable
76+ with :
77+ toolchain : stable
78+ - name : Install nightly Rust
79+ uses : dtolnay/rust-toolchain@stable
80+ with :
81+ toolchain : nightly
82+ - name : Downgrade dependencies to minimal versions
83+ run : cargo +nightly generate-lockfile -Z minimal-versions
84+ - name : Compile with minimal versions
85+ run : cargo +stable check --workspace --all-features --locked
6886 lockfile :
6987 runs-on : ubuntu-latest
7088 steps :
7694 toolchain : stable
7795 - uses : Swatinem/rust-cache@v2
7896 - name : " Is lockfile updated?"
79- run : cargo fetch --locked
97+ run : cargo update --workspace --locked
8098 docs :
8199 name : Docs
82100 runs-on : ubuntu-latest
86104 - name : Install Rust
87105 uses : dtolnay/rust-toolchain@stable
88106 with :
89- toolchain : stable
107+ toolchain : " 1.76 " # STABLE
90108 - uses : Swatinem/rust-cache@v2
91109 - name : Check documentation
92110 env :
@@ -101,9 +119,7 @@ jobs:
101119 - name : Install Rust
102120 uses : dtolnay/rust-toolchain@stable
103121 with :
104- # Not MSRV because its harder to jump between versions and people are
105- # more likely to have stable
106- toolchain : stable
122+ toolchain : " 1.76" # STABLE
107123 components : rustfmt
108124 - uses : Swatinem/rust-cache@v2
109125 - name : Check formatting
@@ -119,16 +135,16 @@ jobs:
119135 - name : Install Rust
120136 uses : dtolnay/rust-toolchain@stable
121137 with :
122- toolchain : " 1.76" # MSRV
138+ toolchain : " 1.76" # STABLE
123139 components : clippy
124140 - uses : Swatinem/rust-cache@v2
125141 - name : Install SARIF tools
126- run : cargo install clippy-sarif --version 0.3.4 -- locked # Held back due to msrv
142+ run : cargo install clippy-sarif --locked
127143 - name : Install SARIF tools
128- run : cargo install sarif-fmt --version 0.3.4 -- locked # Held back due to msrv
144+ run : cargo install sarif-fmt --locked
129145 - name : Check
130146 run : >
131- cargo clippy --workspace --all-features --all-targets --message-format=json -- -D warnings --allow deprecated
147+ cargo clippy --workspace --all-features --all-targets --message-format=json
132148 | clippy-sarif
133149 | tee clippy-results.sarif
134150 | sarif-fmt
@@ -140,3 +156,22 @@ jobs:
140156 wait-for-processing : true
141157 - name : Report status
142158 run : cargo clippy --workspace --all-features --all-targets -- -D warnings --allow deprecated
159+ coverage :
160+ name : Coverage
161+ runs-on : ubuntu-latest
162+ steps :
163+ - name : Checkout repository
164+ uses : actions/checkout@v4
165+ - name : Install Rust
166+ uses : dtolnay/rust-toolchain@stable
167+ with :
168+ toolchain : stable
169+ - uses : Swatinem/rust-cache@v2
170+ - name : Install cargo-tarpaulin
171+ run : cargo install cargo-tarpaulin
172+ - name : Gather coverage
173+ run : cargo tarpaulin --output-dir coverage --out lcov
174+ - name : Publish to Coveralls
175+ uses : coverallsapp/github-action@master
176+ with :
177+ github-token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments