Skip to content

Commit 763d19f

Browse files
committed
chore: move to cargo-nextest as the test runner
1 parent a111a6d commit 763d19f

File tree

2 files changed

+47
-31
lines changed

2 files changed

+47
-31
lines changed

.github/workflows/ci.yml

Lines changed: 45 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
name: CI
2+
permissions:
3+
contents: read
24

35
on:
46
pull_request:
@@ -25,6 +27,7 @@ jobs:
2527
- fmt
2628
- check-features
2729
- test
30+
- build-targets
2831
- minimal-versions
2932
steps:
3033
- run: exit 0
@@ -66,7 +69,7 @@ jobs:
6669
- name: Check minimal versions
6770
env:
6871
# empty those flags!
69-
RUSTFLAGS:
72+
RUSTFLAGS: ""
7073
run: |
7174
# Remove dev-dependencies from Cargo.toml to prevent the next `cargo update`
7275
# from determining minimal versions based on dev-dependencies.
@@ -192,8 +195,10 @@ jobs:
192195
- name: Install Rust
193196
uses: dtolnay/rust-toolchain@stable
194197
- uses: Swatinem/rust-cache@v2
198+
- name: Install cargo-nextest
199+
uses: taiki-e/install-action@cargo-nextest
195200
- name: Test unstable
196-
run: cargo test --all-features
201+
run: cargo nextest run --all-features
197202
env:
198203
RUSTFLAGS: -Dwarnings --cfg tokio_unstable --cfg foundations_unstable
199204
_RJEM_MALLOC_CONF: prof:true
@@ -211,32 +216,23 @@ jobs:
211216
- name: Run example (dry run)
212217
run: cargo run --example http_server -- --dry-run --config examples/http_server/example_conf.yaml
213218

214-
test:
215-
name: Test
219+
build-targets:
220+
name: Build
216221
runs-on: ${{ matrix.os }}
217222
strategy:
218223
matrix:
219224
thing:
220-
- x86_64-linux
221225
- aarch64-linux
222226
- arm64-android
223227
- arm-android
224228
- aarch64-ios
225-
- x86_64-macos
226229
- x86_64-windows
227230
include:
228231
- apt_packages: ""
229232
- custom_env: {}
230-
- build_only: false
231233
- cargo_args: ""
232234

233-
- thing: x86_64-linux
234-
target: x86_64-unknown-linux-gnu
235-
rust: stable
236-
os: ubuntu-latest
237-
238235
- thing: aarch64-linux
239-
build_only: true
240236
target: aarch64-unknown-linux-gnu
241237
rust: stable
242238
os: ubuntu-latest
@@ -247,33 +243,24 @@ jobs:
247243
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-g++
248244

249245
- thing: arm64-android
250-
build_only: true
251246
target: aarch64-linux-android
252247
rust: stable
253248
os: ubuntu-latest
254249
cargo_args: --no-default-features --features server-client-common-default
255250

256251
- thing: arm-android
257-
build_only: true
258252
target: armv7-linux-androideabi
259253
rust: stable
260254
os: ubuntu-latest
261255
cargo_args: --no-default-features --features server-client-common-default
262256

263257
- thing: aarch64-ios
264-
build_only: true
265258
target: aarch64-apple-ios
266259
rust: stable
267260
os: macos-latest
268261
cargo_args: --no-default-features --features server-client-common-default
269262

270-
- thing: x86_64-macos
271-
target: x86_64-apple-darwin
272-
rust: stable
273-
os: macos-latest
274-
275263
- thing: x86_64-windows
276-
build_only: true
277264
target: x86_64-pc-windows-msvc
278265
rust: stable
279266
os: windows-latest
@@ -296,13 +283,42 @@ jobs:
296283
- name: Set Android Linker path
297284
if: endsWith(matrix.thing, '-android')
298285
run: echo "CARGO_TARGET_$(echo ${{ matrix.target }} | tr \\-a-z _A-Z)_LINKER=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/$(echo ${{ matrix.target }} | sed s/armv7/armv7a/)21-clang++" >> "$GITHUB_ENV"
299-
- name: Build tests
300-
# We `build` because we want the linker to verify we are cross-compiling correctly for check-only targets.
301-
run: cargo build --target ${{ matrix.target }} ${{matrix.cargo_args}}
286+
- name: Build
287+
run: cargo build -p foundations --target ${{ matrix.target }} ${{matrix.cargo_args}}
302288
shell: bash
303289
env: ${{ matrix.custom_env }}
304-
- name: Run tests
305-
if: "!matrix.build_only"
306-
run: _RJEM_MALLOC_CONF=prof:true cargo test --target ${{ matrix.target }} ${{matrix.cargo_args}}
290+
291+
test:
292+
name: Test
293+
runs-on: ${{ matrix.os }}
294+
strategy:
295+
matrix:
296+
thing:
297+
- x86_64-linux
298+
- x86_64-macos
299+
include:
300+
- thing: x86_64-linux
301+
target: x86_64-unknown-linux-gnu
302+
rust: stable
303+
os: ubuntu-latest
304+
305+
- thing: x86_64-macos
306+
target: x86_64-apple-darwin
307+
rust: stable
308+
os: macos-latest
309+
310+
steps:
311+
- uses: actions/checkout@v4
312+
with:
313+
submodules: "recursive"
314+
- name: Install Rust
315+
uses: dtolnay/rust-toolchain@master
316+
with:
317+
toolchain: ${{ matrix.rust }}
318+
targets: ${{ matrix.target }}
319+
- uses: Swatinem/rust-cache@v2
320+
- name: Install cargo-nextest
321+
uses: taiki-e/install-action@cargo-nextest
322+
- name: Run foundations tests
323+
run: _RJEM_MALLOC_CONF=prof:true cargo nextest run --target ${{ matrix.target }}
307324
shell: bash
308-
env: ${{ matrix.custom_env }}

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
## Build & Test Commands
44
- Build: `cargo build`
5-
- Test all: `cargo test`
6-
- Test single: `cargo test <test_name>` or `cargo test --test <file> <test_name>`
5+
- Test all: `cargo nextest run`
6+
- Test single: `cargo nextest run <test_name>` or `cargo nextest run --test <file> <test_name>`
77
- Clippy: `cargo clippy --all-targets -- -D warnings -D unreachable_pub -D clippy::await_holding_lock -D clippy::clone_on_ref_ptr`
88
- Format: `cargo fmt --all`
99
- Lint fix: `./scripts/lint-fix.sh`

0 commit comments

Comments
 (0)