Skip to content

Commit 8e373df

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 f26895a commit 8e373df

File tree

4 files changed

+27
-14
lines changed

4 files changed

+27
-14
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 "default unstable-locales rkyv-64 rkyv-validation rustc-serialize serde arbitrary"
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 "default unstable-locales rkyv-64 rkyv-validation rustc-serialize serde arbitrary"
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

+13-9
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 "default unstable-locales rkyv-64 rkyv-validation rustc-serialize serde arbitrary"
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.60
@@ -61,8 +65,8 @@ jobs:
6165
- run: cargo check --manifest-path fuzz/Cargo.toml --all-targets
6266
# run --lib and --doc to avoid the long running integration tests
6367
# which are run elsewhere
64-
- run: cargo test --lib --all-features --color=always -- --color=always
65-
- run: cargo test --doc --all-features --color=always -- --color=always
68+
- run: cargo test --lib ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --color=always -- --color=always
69+
- run: cargo test --doc ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --color=always -- --color=always
6670

6771
features_check:
6872
strategy:
@@ -76,7 +80,7 @@ jobs:
7680
- uses: Swatinem/rust-cache@v2
7781
- run: |
7882
cargo hack check --feature-powerset --optional-deps serde \
79-
--skip __internal_bench,iana-time-zone,pure-rust-locales,libc,winapi \
83+
--skip __internal_bench,iana-time-zone,pure-rust-locales,libc,winapi,rkyv-16,rkyv-32,rkyv-validation \
8084
--all-targets
8185
# run using `bash` on all platforms for consistent
8286
# line-continuation marks
@@ -182,16 +186,16 @@ jobs:
182186
- uses: actions/checkout@v4
183187
- run: cargo install cross
184188
- uses: Swatinem/rust-cache@v2
185-
- run: cross test --lib --all-features --target i686-unknown-linux-gnu --color=always
186-
- run: cross test --doc --all-features --target i686-unknown-linux-gnu --color=always
187-
- run: cross test --lib --all-features --target i686-unknown-linux-musl --color=always
188-
- run: cross test --doc --all-features --target i686-unknown-linux-musl --color=always
189+
- run: cross test --lib ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --target i686-unknown-linux-gnu --color=always
190+
- run: cross test --doc ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --target i686-unknown-linux-gnu --color=always
191+
- run: cross test --lib ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --target i686-unknown-linux-musl --color=always
192+
- run: cross test --doc ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --target i686-unknown-linux-musl --color=always
189193

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

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ unstable-locales = ["pure-rust-locales"]
3232
rkyv-16 = ["rkyv", "rkyv?/size_16"]
3333
rkyv-32 = ["rkyv", "rkyv?/size_32"]
3434
rkyv-64 = ["rkyv", "rkyv?/size_64"]
35-
rkyv-validation = ["rkyv?/validation"]
35+
rkyv-validation = ["rkyv", "rkyv?/validation"]
3636
# Features for internal use only:
3737
__internal_bench = []
3838

0 commit comments

Comments
 (0)