Prevent dev dependencies from breaking tests and examples #219
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
pull_request: | |
branches: | |
- master | |
- "[0-9]+.[0-9]+" | |
push: | |
branches: | |
- staging | |
- trying | |
name: Continuous integration | |
jobs: | |
compile_and_test: | |
name: Compile and test | |
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 | |
- 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 | |
shell: bash | |
working-directory: palette | |
run: bash ../scripts/test_features.sh | |
- name: "Test #[no_std]" | |
if: ${{ runner.os == 'Linux' && matrix.toolchain == 'nightly' }} | |
run: cargo build -v --package no_std_test --features nightly --target thumbv6m-none-eabi | |
miri: | |
name: Miri tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: miri | |
- name: Unit tests | |
run: cargo miri test --lib --features "bytemuck" -- -Z unstable-options --report-time | |
- name: Documentation tests | |
run: cargo miri test --doc --features "bytemuck" -- -Z unstable-options --report-time | |
# Refs: https://github.com/rust-lang/crater/blob/9ab6f9697c901c4a44025cf0a39b73ad5b37d198/.github/workflows/bors.yml#L125-L149 | |
# | |
# ALL THE PREVIOUS JOBS NEEDS TO BE ADDED TO THE `needs` SECTION OF THIS JOB! | |
ci-success: | |
name: ci | |
if: success() | |
needs: | |
- compile_and_test | |
- miri | |
runs-on: ubuntu-latest | |
steps: | |
- name: Mark the job as a success | |
run: exit 0 |