name: CI
on:
push:
branches: [main]
pull_request:
workflow_call:
env:
CARGO_TERM_COLOR: always
jobs:
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Install protoc
run: sudo apt-get update -y && sudo apt-get install -y protobuf-compiler
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --workspace --all-targets --all-features -- -D warnings
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install protoc
run: sudo apt-get update -y && sudo apt-get install -y protobuf-compiler
- uses: Swatinem/rust-cache@v2
- run: cargo test --workspace --all-features
features:
name: Feature Matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- features: --no-default-features
label: no-features
- features: --features mesh-translator
label: with-mesh-translator
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install protoc
run: sudo apt-get update -y && sudo apt-get install -y protobuf-compiler
- uses: Swatinem/rust-cache@v2
with:
key: features-${{ matrix.label }}
- run: cargo check -p peat-tak ${{ matrix.features }}
audit:
name: Security Audit
continue-on-error: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo generate-lockfile
- uses: rustsec/audit-check@v2.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}