Skip to content

Commit 75de8b0

Browse files
committed
Integrate cargo-careful for nightly tests on CI
1 parent 851b58d commit 75de8b0

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,15 @@ jobs:
140140
- uses: dtolnay/rust-toolchain@v1
141141
with:
142142
toolchain: ${{ matrix.toolchain }}
143+
components: rust-src
143144
- run: rustup default ${{ matrix.toolchain }}
144145

146+
- run: cargo install cargo-careful
147+
if: ${{ matrix.toolchain == 'nightly' }}
148+
145149
- run: make test.cargo
150+
careful=${{ (matrix.toolchain == 'nightly' && 'yes')
151+
|| 'no' }}
146152

147153

148154

Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,21 @@ cargo.test: test.cargo
9494
# Run Rust tests of project crate.
9595
#
9696
# Usage:
97-
# make test.cargo
97+
# make test.cargo [careful=(no|yes)]
9898

9999
test.cargo:
100-
cargo test -p cucumber-expressions --all-features
100+
ifeq ($(careful),yes)
101+
ifeq ($(shell cargo install --list | grep cargo-careful),)
102+
cargo install cargo-careful
103+
endif
104+
ifeq ($(shell rustup component list --toolchain=nightly \
105+
| grep 'rust-src (installed)'),)
106+
rustup component add --toolchain=nightly rust-src
107+
endif
108+
endif
109+
cargo $(if $(call eq,$(careful),yes),+nightly careful,) test \
110+
-p cucumber-expressions \
111+
--all-features
101112

102113

103114

0 commit comments

Comments
 (0)