Skip to content

Commit 943120e

Browse files
Merge pull request #2033 from kristof-mattei/allow-cargo-features-selection
fix: allow cargo features selection
2 parents 9ecff73 + 6372af0 commit 943120e

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ permissions:
2020

2121
env:
2222
CARGO_TERM_COLOR: always
23+
CARGO_FEATURES: --all-features
2324
# Use docker.io for Docker Hub if empty
2425
REGISTRY: ghcr.io
2526
# github.repository as <account>/<repo>
@@ -44,6 +45,9 @@ jobs:
4445
changes:
4546
name: Detect changes
4647
runs-on: ubuntu-latest
48+
permissions:
49+
contents: read
50+
pull-requests: read
4751
outputs:
4852
code: ${{ steps.filter.outputs.code }}
4953
steps:
@@ -62,6 +66,8 @@ jobs:
6266
calculate-version:
6367
name: Calculate version
6468
runs-on: ubuntu-latest
69+
permissions:
70+
contents: read
6571
needs:
6672
- changes
6773
- repo-has-container
@@ -201,7 +207,7 @@ jobs:
201207
- name: Build
202208
shell: bash
203209
run: |
204-
cargo build --all-features --all-targets --locked --workspace --verbose
210+
cargo build ${{ env.CARGO_FEATURES }} --all-targets --locked --workspace --verbose
205211
206212
cargo-fmt:
207213
name: Cargo fmt
@@ -344,7 +350,7 @@ jobs:
344350
# build-* ones are not parsed by grcov
345351
LLVM_PROFILE_FILE: "profiling/build-%p-%m.profraw"
346352
run: |
347-
cargo build --all-features --all-targets --locked --workspace --verbose
353+
cargo build ${{ env.CARGO_FEATURES }} --all-targets --locked --workspace --verbose
348354
349355
- name: Run nextest
350356
shell: bash
@@ -353,7 +359,7 @@ jobs:
353359
RUSTFLAGS: "${{ env.RUSTFLAGS }} --allow=warnings -Cinstrument-coverage"
354360
LLVM_PROFILE_FILE: "profiling/profile-%p-%m.profraw"
355361
run: |
356-
cargo nextest run --profile ci --no-fail-fast --all-targets --all-features --workspace
362+
cargo nextest run --profile ci --no-fail-fast ${{ env.CARGO_FEATURES }} --all-targets --workspace
357363
continue-on-error: true
358364

359365
- name: Upload test results
@@ -456,7 +462,7 @@ jobs:
456462
- name: Run Clippy for GitHub Actions report
457463
uses: actions-rs-plus/clippy-check@fe8905c5766416f0593a503a2230a7c83141a8f0 # v2.3.0
458464
with:
459-
args: --all-features --all-targets --locked --workspace --verbose
465+
args: ${{ env.CARGO_FEATURES }} --all-targets --locked --workspace --verbose
460466

461467
docker-build:
462468
name: Build Docker container on ${{ matrix.runs-on }} for ${{ matrix.platform }}
@@ -477,6 +483,7 @@ jobs:
477483
unique_tag: ${{ steps.variables.outputs.unique_tag }}
478484
runs-on: ${{ matrix.runs-on }}
479485
permissions:
486+
contents: read
480487
packages: write
481488
needs:
482489
- calculate-version

0 commit comments

Comments
 (0)