name: ci
on:
pull_request: {}
push:
branches: [main]
jobs:
check:
runs-on: ubuntu-latest
env:
SIMDOC_TOOLING_MANIFEST: ${{ github.workspace }}/sim-tooling/Cargo.toml
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- uses: actions/checkout@v4
with:
repository: sim-nest/sim-tooling
path: sim-tooling
- id: toolchain
shell: bash
run: |
channel="$(sed -n 's/^channel = "\(.*\)"/\1/p' rust-toolchain.toml)"
if [ -z "$channel" ]; then
echo "missing rust-toolchain.toml channel" >&2
exit 1
fi
echo "channel=$channel" >> "$GITHUB_OUTPUT"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.toolchain.outputs.channel }}
components: rustfmt, clippy
- run: cargo fmt --all --check
- run: cargo test --workspace
- run: cargo test --workspace --all-features
- run: cargo clippy --workspace --all-targets -- -D warnings
- run: cargo doc --workspace --no-deps
env:
RUSTDOCFLAGS: -D warnings
- run: cargo run -p xtask -- simdoc --check
env:
SIMDOC_TOOLING_MANIFEST: ${{ github.workspace }}/sim-tooling/Cargo.toml
- run: cargo run -p xtask -- check-file-sizes