Skip to content

Commit 364d04e

Browse files
committed
ci: test builder feature
1 parent 1932269 commit 364d04e

File tree

3 files changed

+32
-11
lines changed

3 files changed

+32
-11
lines changed

.github/workflows/_build-rust.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,27 +80,27 @@ jobs:
8080
key: ${{ runner.os }}-rust-${{ inputs.rust-version }}-cargo-${{ hashFiles('**/Cargo.toml', '**/Cargo.lock') }}
8181
- run: cargo version
8282
- name: Build (library)
83-
run: cargo build --target ${{ inputs.rust-target }} --features ${{ inputs.features }}
83+
run: cargo build --target ${{ inputs.rust-target }} --features ${{ inputs.features }} --no-default-features
8484
- name: Build (all targets)
85-
run: cargo build --all-targets --features ${{ inputs.features }}
85+
run: cargo build --all-targets --features ${{ inputs.features }} --no-default-features
8686
- name: Code Formatting
8787
if: inputs.do-style-check
8888
run: cargo fmt --all -- --check
8989
- name: Code Style and Doc Style
9090
if: inputs.do-style-check
9191
run: |
92-
cargo doc --document-private-items --features ${{ inputs.features }}
93-
cargo clippy --all-targets --features ${{ inputs.features }}
92+
cargo doc --document-private-items --features ${{ inputs.features }} --no-default-features
93+
cargo clippy --all-targets --features ${{ inputs.features }} --no-default-features
9494
- name: Unit Test (UNIX)
9595
if: inputs.do-test && runner.os != 'Windows'
9696
run: |
9797
curl -LsSf https://get.nexte.st/latest/linux | tar zxf -
9898
chmod u+x cargo-nextest
99-
./cargo-nextest nextest run --features ${{ inputs.features }}
99+
./cargo-nextest nextest run --features ${{ inputs.features }} --no-default-features
100100
- name: Unit Test (Windows)
101101
if: inputs.do-test && runner.os == 'Windows'
102102
run: |
103103
Invoke-WebRequest https://get.nexte.st/latest/windows -OutFile cargo-nextest.zip
104104
Expand-Archive .\cargo-nextest.zip
105105
cp .\cargo-nextest/cargo-nextest.exe .
106-
.\cargo-nextest.exe nextest run --features ${{ inputs.features }}
106+
.\cargo-nextest.exe nextest run --features ${{ inputs.features }} --no-default-features

.github/workflows/rust.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,23 @@ jobs:
2222
with:
2323
rust-version: 1.56.1
2424
do-style-check: false
25+
features: builder
2526

2627
build_stable:
2728
name: build (stable)
2829
uses: ./.github/workflows/_build-rust.yml
2930
with:
3031
rust-version: stable
3132
do-style-check: false
33+
features: builder
3234

3335
build_nightly:
3436
name: build (nightly)
3537
uses: ./.github/workflows/_build-rust.yml
3638
with:
3739
rust-version: nightly
3840
do-style-check: false
39-
features: unstable
41+
features: builder,unstable
4042

4143
### no-std Build #########################
4244
build_nostd_msrv:
@@ -47,6 +49,7 @@ jobs:
4749
rust-version: 1.56.1
4850
do-style-check: false
4951
rust-target: thumbv7em-none-eabihf
52+
features: builder
5053

5154
build_nostd_stable:
5255
name: build no_std (stable)
@@ -56,6 +59,17 @@ jobs:
5659
rust-version: stable
5760
do-style-check: false
5861
rust-target: thumbv7em-none-eabihf
62+
features: builder
63+
64+
# Also tests the build one time without the "builder" feature.
65+
build_nostd_stable_no_builder:
66+
name: build no_std (stable) [w/o builder]
67+
needs: build_stable
68+
uses: ./.github/workflows/_build-rust.yml
69+
with:
70+
rust-version: stable
71+
do-style-check: false
72+
rust-target: thumbv7em-none-eabihf
5973

6074
# We perform one single run also in Windows. This should be sufficient to
6175
# check that devs can also use this on Windows.
@@ -65,11 +79,12 @@ jobs:
6579
with:
6680
runs-on: windows-latest
6781
# Quirk for the Windows powershell and its handling of empty arguments.
68-
features: >
69-
'""'
82+
# features: >
83+
# '""'
7084
rust-version: stable
7185
do-style-check: false
7286
rust-target: thumbv7em-none-eabihf
87+
features: builder
7388

7489
build_nostd_nightly:
7590
name: build no_std (nightly)
@@ -79,7 +94,7 @@ jobs:
7994
rust-version: nightly
8095
do-style-check: false
8196
rust-target: thumbv7em-none-eabihf
82-
features: unstable
97+
features: builder,unstable
8398

8499
### Style Checks + Doc #####################
85100
style_msrv:
@@ -90,6 +105,7 @@ jobs:
90105
rust-version: 1.56.1
91106
do-style-check: true
92107
do-test: false
108+
features: builder
93109

94110
style_stable:
95111
name: style (stable)
@@ -99,6 +115,7 @@ jobs:
99115
rust-version: stable
100116
do-style-check: true
101117
do-test: false
118+
features: builder
102119

103120
style_nightly:
104121
name: style (nightly)
@@ -108,4 +125,4 @@ jobs:
108125
rust-version: nightly
109126
do-style-check: true
110127
do-test: false
111-
features: unstable
128+
features: builder,unstable

multiboot2-header/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ homepage = "https://github.com/rust-osdev/multiboot2-header"
2727
repository = "https://github.com/rust-osdev/multiboot2"
2828
documentation = "https://docs.rs/multiboot2-header"
2929

30+
[[example]]
31+
name = "minimal"
32+
required-features = ["builder"]
33+
3034
[features]
3135
default = ["builder"]
3236
alloc = []

0 commit comments

Comments
 (0)