Skip to content

Commit

Permalink
Restructure CI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ogeon committed Sep 1, 2023
1 parent fc6c530 commit 4c29b26
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 14 deletions.
47 changes: 35 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,55 @@ on:
name: Continuous integration

jobs:
compile_and_test:
name: Compile and test
compile_and_test_msrv:
name: Compile and test MSRV
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
toolchain: [1.60.0, stable, beta, nightly]
runs-on: ${{ matrix.os }}
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
targets: thumbv6m-none-eabi
- uses: dtolnay/[email protected]
- name: Minimal check
run: cargo check -v -p palette --no-default-features --features std
- name: find-crate check
run: cargo check -v -p palette --no-default-features --features "std find-crate"
- name: Default check
run: cargo check -v --workspace --exclude no_std_test
- run: cargo test -v
- name: Test features
- name: Test all features
run: cargo test -v -p palette --all-features
- name: Test each feature
shell: bash
working-directory: palette
run: bash ../scripts/test_features.sh
- name: "Test #[no_std]"
if: ${{ runner.os == 'Linux' && matrix.toolchain == 'nightly' }}
check_stable_beta_nightly:
name: Quick check
strategy:
matrix:
toolchain: [beta, stable, nightly]
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- name: Check all features
run: cargo check -v -p palette --all-features
no_std:
name: "Test #[no_std]"
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
targets: thumbv6m-none-eabi
- name: "Build with #[no_std]"
run: cargo build -v --package no_std_test --features nightly --target thumbv6m-none-eabi
miri:
name: Miri tests
Expand All @@ -61,7 +82,9 @@ jobs:
name: ci
if: success()
needs:
- compile_and_test
- compile_and_test_msrv
- check_stable_beta_nightly
- no_std
- miri
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 2 additions & 2 deletions scripts/test_features.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ echo -e "features: $features\n"

#Test without any optional feature
echo testing with --no-default-features --features "$required_features"
cargo test --no-default-features --features "$required_features"
cargo test --tests --no-default-features --features "$required_features"

#Isolated test of each optional feature
for feature in $features; do
echo testing with --no-default-features --features "\"$feature $required_features\""
cargo test --no-default-features --features "$feature $required_features"
cargo test --tests --no-default-features --features "$feature $required_features"
done

0 comments on commit 4c29b26

Please sign in to comment.