Skip to content

Commit ead2720

Browse files
committed
Change the CI --all-features to an explicit list.
This is due to the mutually exclusive features in rkyv which we expose now. `--all-features` will now activate them and the crate will fail to compile rkyv. We work around this by defining an explicit list of all mutually exclusive features to. Unfortunately there isn't an easy way to share env variables among different YAML files (actions/runner#655). There also isn't a good way to specify --all-features minus "just a few" (rust-lang/cargo#3126) aside from giving the complete list. Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
1 parent 3728017 commit ead2720

File tree

3 files changed

+25
-12
lines changed

3 files changed

+25
-12
lines changed

.github/workflows/codecov.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
name: codecov
2+
3+
env:
4+
# It's really `--all-features`, but not adding the mutually exclusive features from rkyv
5+
ALL_NON_EXCLUSIVE_FEATURES: --features "libc winapi unstable-locales rkyv serde arbitrary iana-time-zone android-tzdata"
6+
27
on:
38
push:
49
branches: [main, 0.4.x]
@@ -18,7 +23,7 @@ jobs:
1823
- name: Install cargo-llvm-cov
1924
uses: taiki-e/install-action@cargo-llvm-cov
2025
- name: Generate code coverage
21-
run: cargo +nightly llvm-cov --all-features --workspace --lcov --doctests --output-path lcov.info
26+
run: cargo +nightly llvm-cov ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --workspace --lcov --doctests --output-path lcov.info
2227
- name: Upload coverage to Codecov
2328
uses: codecov/codecov-action@v3
2429
env:

.github/workflows/lint.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: lint
22

3+
env:
4+
# It's really `--all-features`, but not adding the mutually exclusive features from rkyv
5+
ALL_NON_EXCLUSIVE_FEATURES: --features "libc winapi unstable-locales rkyv serde arbitrary iana-time-zone android-tzdata"
6+
37
on:
48
push:
59
branches: [main, 0.4.x]
@@ -19,7 +23,7 @@ jobs:
1923
- run: cargo fmt --check --manifest-path fuzz/Cargo.toml
2024
- run: cargo fmt --check --manifest-path bench/Cargo.toml
2125
- run: |
22-
cargo clippy --all-features --all-targets --color=always \
26+
cargo clippy ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --all-targets --color=always \
2327
-- -D warnings
2428
- run: |
2529
cargo clippy --manifest-path fuzz/Cargo.toml --color=always \
@@ -50,8 +54,8 @@ jobs:
5054
- uses: actions/checkout@v4
5155
- uses: dtolnay/rust-toolchain@stable
5256
- run: cargo install cargo-deadlinks
53-
- run: cargo deadlinks -- --all-features
54-
- run: cargo doc --all-features --no-deps
57+
- run: cargo deadlinks -- ${{ env.ALL_NON_EXCLUSIVE_FEATURES }}
58+
- run: cargo doc ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --no-deps
5559
env:
5660
RUSTDOCFLAGS: -Dwarnings
5761

.github/workflows/test.yml

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: All Tests and Builds
22

3+
env:
4+
# It's really `--all-features`, but not adding the mutually exclusive features from rkyv
5+
ALL_NON_EXCLUSIVE_FEATURES: --features "libc winapi unstable-locales rkyv serde arbitrary iana-time-zone android-tzdata"
6+
37
on:
48
push:
59
branches: [main, 0.4.x]
@@ -16,7 +20,7 @@ jobs:
1620
- uses: actions/checkout@v4
1721
- uses: dtolnay/rust-toolchain@stable
1822
- uses: Swatinem/rust-cache@v2
19-
- run: cargo test --all-features --color=always -- --color=always
23+
- run: cargo test ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --color=always -- --color=always
2024

2125
# later this may be able to be included with the below
2226
# kept separate for now as the following don't compile on 1.57
@@ -59,8 +63,8 @@ jobs:
5963
- run: cargo check --manifest-path fuzz/Cargo.toml --all-targets
6064
# run --lib and --doc to avoid the long running integration tests
6165
# which are run elsewhere
62-
- run: cargo test --lib --all-features --color=always -- --color=always
63-
- run: cargo test --doc --all-features --color=always -- --color=always
66+
- run: cargo test --lib ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --color=always -- --color=always
67+
- run: cargo test --doc ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --color=always -- --color=always
6468

6569
features_check:
6670
strategy:
@@ -181,16 +185,16 @@ jobs:
181185
- uses: actions/checkout@v4
182186
- run: cargo install cross
183187
- uses: Swatinem/rust-cache@v2
184-
- run: cross test --lib --all-features --target i686-unknown-linux-gnu --color=always
185-
- run: cross test --doc --all-features --target i686-unknown-linux-gnu --color=always
186-
- run: cross test --lib --all-features --target i686-unknown-linux-musl --color=always
187-
- run: cross test --doc --all-features --target i686-unknown-linux-musl --color=always
188+
- run: cross test --lib ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --target i686-unknown-linux-gnu --color=always
189+
- run: cross test --doc ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --target i686-unknown-linux-gnu --color=always
190+
- run: cross test --lib ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --target i686-unknown-linux-musl --color=always
191+
- run: cross test --doc ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --target i686-unknown-linux-musl --color=always
188192

189193
check-docs:
190194
runs-on: ubuntu-latest
191195
steps:
192196
- uses: actions/checkout@v4
193197
- uses: dtolnay/rust-toolchain@nightly
194-
- run: cargo +nightly doc --all-features --no-deps
198+
- run: cargo +nightly doc ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --no-deps
195199
env:
196200
RUSTDOCFLAGS: "-D warnings --cfg docsrs"

0 commit comments

Comments
 (0)