Skip to content

Commit e062bb1

Browse files
committed
CI: Specify cargo arguments instead of features in matrix
With an upcoming change the novendor feature will be deprecated and should no longer be used. It will be replaced by building the library without any features. To express that in CI, switch from having a "features" argument to a more general "args", which will simply hold --no-default-features for the case where no features are desired (but for now no semantic change is made). Signed-off-by: Daniel Müller <[email protected]>
1 parent 181b268 commit e062bb1

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,30 @@ on:
66
jobs:
77
test-gnu:
88
# dynamically linked glibc
9-
name: Test on Ubuntu ${{ matrix.os-arch }} (${{ matrix.features }})
9+
name: Test on Ubuntu ${{ matrix.os-arch }} (${{ matrix.args }})
1010
strategy:
1111
matrix:
1212
include:
1313
- rust-target: x86_64-unknown-linux-gnu
1414
os-target: x86_64-linux-gnu
1515
os-arch: amd64
16-
features: ''
16+
args: ''
1717

1818
- rust-target: x86_64-unknown-linux-gnu
1919
os-target: x86_64-linux-gnu
2020
os-arch: amd64
21-
features: novendor
21+
args: --features=novendor
22+
install-sys-libbpf: y
2223

2324
- rust-target: aarch64-unknown-linux-gnu
2425
os-target: aarch64-linux-gnu
2526
os-arch: arm64
26-
features: ''
27+
args: ''
2728

2829
- rust-target: powerpc64le-unknown-linux-gnu
2930
os-target: powerpc64le-linux-gnu
3031
os-arch: ppc64el
31-
features: ''
32+
args: ''
3233
runs-on: ubuntu-latest
3334
env:
3435
CARGO_BUILD_TARGET: ${{ matrix.rust-target }}
@@ -61,7 +62,7 @@ jobs:
6162
zlib1g-dev:${{ matrix.os-arch }}
6263
6364
- name: Install libbpf-dev
64-
if: matrix.features == 'novendor'
65+
if: matrix.install-sys-libbpf == 'y'
6566
run: sudo apt-get install libbpf-dev:${{ matrix.os-arch }}
6667

6768
- name: Install linker for ${{ matrix.os-target }}
@@ -73,20 +74,21 @@ jobs:
7374
with:
7475
targets: ${{ matrix.rust-target }}
7576

76-
- run: cargo build --features "${{ matrix.features }}"
77+
- run: cargo build ${{ matrix.args }}
7778

78-
- run: cargo test --features "${{ matrix.features }}"
79+
- run: cargo test ${{ matrix.args }}
7980
if: matrix.os-arch == 'amd64'
8081

8182
test-musl:
8283
# dynamically linked musl libc
83-
name: Test on Alpine Linux x86_64 (${{ matrix.features }})
84+
name: Test on Alpine Linux x86_64 (${{ matrix.args }})
8485
runs-on: ubuntu-latest
8586
strategy:
8687
matrix:
87-
features:
88-
- ''
89-
- novendor
88+
include:
89+
- args: ''
90+
- args: --features=novendor
91+
install-sys-libbpf: y
9092
env:
9193
CARGO_TERM_VERBOSE: 'true'
9294
steps:
@@ -107,14 +109,14 @@ jobs:
107109
zlib-dev
108110
109111
- name: Install libbpf-dev
110-
if: matrix.features == 'novendor'
112+
if: matrix.install-sys-libbpf == 'y'
111113
run: apk add libbpf-dev
112114
shell: alpine.sh --root {0}
113115

114-
- run: cargo build --features "${{ matrix.features }}"
116+
- run: cargo build ${{ matrix.args }}
115117
shell: alpine.sh {0}
116118

117-
- run: cargo test --features "${{ matrix.features }}"
119+
- run: cargo test ${{ matrix.args }}
118120
shell: alpine.sh {0}
119121

120122
test-libbpf-rs:

0 commit comments

Comments
 (0)