name: Check and Test Build
on:
push:
branches:
- "**"
paths-ignore:
- ".github/**"
tags-ignore:
- "**"
workflow_dispatch:
jobs:
format:
name: code format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Run Rustfmt
run: cargo +nightly fmt --all -- --check
check:
name: clippy check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Run Clippy
run: cargo clippy --locked --all-targets -- -D warnings
test-build:
name: test ${{ matrix.target }}
runs-on: ${{ matrix.os }}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-musl
os: ubuntu-24.04
- target: aarch64-unknown-linux-musl
os: ubuntu-24.04-arm
- target: x86_64-apple-darwin
os: macos-15-intel
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
- target: aarch64-pc-windows-msvc
os: windows-11-arm
steps:
- uses: actions/checkout@v6
- name: Install Cross-Compilation Tools
if: contains(matrix.target, 'linux-musl')
run: |
sudo apt-get update
sudo apt-get install -y musl-tools pkg-config libssl-dev
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.target }}
- name: Run Cargo
run: cargo build --locked --target ${{ matrix.target }}