on:
pull_request:
branches: [main]
push:
branches: [main, staging, trying]
name: CI
jobs:
test:
name: test
runs-on: ubuntu-latest
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
toolchain: stable
test: true
macros_test: true
- target: i686-unknown-linux-musl
toolchain: stable
test: true
- target: thumbv7m-none-eabi
toolchain: stable
no_panics: true
- target: x86_64-unknown-linux-gnu
toolchain: nightly
miri: true
steps:
- uses: actions/checkout@v3
- name: Set up toolchain
run: |
rustup default ${{ matrix.toolchain }}
rustup target add ${{ matrix.target }}
- name: Build ufmt
run: |
cargo check -p ufmt --target ${{ matrix.target }}
- name: Build ufmt-utils
if: ${{ matrix.only_build_ufmt }}
run: |
cargo check -p ufmt-utils --target ${{ matrix.target }}
- name: Run tests
if: ${{ matrix.test }}
run: |
cargo test --target ${{ matrix.target }} --features std
- name: Run tests in macros crate
if: ${{ matrix.macros_test }}
run: |
cd macros
cargo test
- name: Check absence of panicking branches
if: ${{ matrix.no_panics }}
run: |
cd nopanic
cargo build --target ${{ matrix.target }} --examples --release
size $(find target/${{ matrix.target }}/release/examples -executable -type f ! -name '*-*' | sort)
- name: Run tests within miri
if: ${{ matrix.miri }}
run: |
rustup component add miri
cargo miri test --features std
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run clippy (workspace)
run: |
cargo clippy
- name: Run clippy (nopanic)
run: |
cd nopanic
cargo clippy
ci-success:
name: ci
if: github.event_name == 'push' && success()
needs:
- test
- clippy
runs-on: ubuntu-latest
steps:
- name: Mark the job as a success
run: exit 0