name: Checks
on:
push:
branches: [dev]
pull_request:
branches-ignore: [main]
jobs:
fmt:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt
- run: cargo +nightly fmt --check
check:
name: cargo check
strategy:
fail-fast: false
matrix:
features:
- no_std
include:
- cargo: cargo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: ${{ matrix.cargo }} check --all-targets ${{ matrix.features }}
doc:
name: cargo doc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: RUSTFLAGS="--cfg docsrs" cargo +nightly doc -F full
build_and_test:
strategy:
fail-fast: false
matrix:
profile:
- dev
- release
target:
- runner: ubuntu-latest
target: x86_64-unknown-linux-gnu
- runner: windows-latest
target: x86_64-pc-windows-msvc
- runner: windows-latest
target: i686-pc-windows-msvc
needs: [fmt, check] runs-on: ${{ matrix.target.runner }}
steps:
- uses: actions/checkout@v4
- run: rustup target add ${{ matrix.target.target }}
- name: build and test
run: cargo test --target ${{ matrix.target.target }} --profile ${{ matrix.profile }}
all_checks_pass:
needs:
- fmt
- check
- doc
- build_and_test
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}