Skip to content

Commit 3a5c77a

Browse files
authored
test: Improve test work flow (#331)
Changes to cargo hack for 32 and 64 bit: * make sure doc tests are run * make sure that default features are tested For 32 bit: * run cargo hack check for all targets + powerset For valgrind: * run all targets and doc tests For clippy: * use cargo hack on feature powerset
1 parent 722a934 commit 3a5c77a

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed

.github/workflows/test32bit.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ jobs:
3838
- name: Install rust tooling for 32 bit builds
3939
run: |
4040
rustup target install i686-unknown-linux-gnu
41+
- name: cargo check
42+
run: |
43+
cargo hack check --all-targets --target=i686-unknown-linux-gnu --feature-powerset
4144
- name: cargo tests
4245
run: |
4346
cargo hack test --target=i686-unknown-linux-gnu --feature-powerset
47+
- name: cargo doc tests
48+
run: |
49+
cargo hack test --doc --target=i686-unknown-linux-gnu --feature-powerset

.github/workflows/tests.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,15 @@ jobs:
3535
- run: sudo apt-get update -y
3636
if: matrix.os == 'ubuntu-latest'
3737
- name: cargo check (powerset)
38-
run: cargo hack check --feature-powerset --no-dev-deps --exclude-no-default-features
39-
- name: cargo check examples
40-
run: cargo hack check --examples --feature-powerset --exclude-no-default-features
41-
- name: run tests
38+
run: cargo hack check --feature-powerset --no-dev-deps
39+
- name: cargo check examples (powerset)
40+
run: cargo hack check --examples --feature-powerset
41+
- name: run tests (powerset)
4242
run: |
43-
cargo hack test --feature-powerset --exclude-no-default-features
44-
cargo hack test --examples --feature-powerset --exclude-no-default-features
43+
cargo hack test --all-targets --feature-powerset
44+
- name: run doc tests (powerset)
45+
run: |
46+
cargo hack test --doc --feature-powerset
4547
4648
fmt:
4749
name: rust fmt
@@ -76,8 +78,7 @@ jobs:
7678
toolchain: ${{ matrix.rust }}
7779
override: true
7880
- uses: Swatinem/rust-cache@v1
81+
- uses: taiki-e/install-action@cargo-hack
7982
- run: rustup component add clippy
80-
- name: clippy (all targets)
81-
run: cargo clippy --all-targets --all-features -- -D warnings
82-
- name: clippy (all targets, all features)
83-
run: cargo clippy --all-targets -- -D warnings
83+
- name: clippy (all targets, feature powerset)
84+
run: cargo hack clippy --all-targets --feature-powerset -- -D warnings

.github/workflows/valgrind.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,7 @@ jobs:
3535
- run: cargo install cargo-valgrind
3636
- name: run cargo valgrind
3737
run: |
38-
cargo valgrind test --all-features
38+
cargo valgrind test --all-targets --all-features
39+
- name: run cargo valgrind on doc tests
40+
run: |
41+
cargo valgrind test --doc --all-features

0 commit comments

Comments
 (0)