name: Rust
run-name: Cargo fmt check and Build check on different OS
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
cargo-fmt-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check formatting
run: cargo fmt --check
build-native:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build
- name: Run demo
run: cargo run --example demo
- name: Run unit test
run: cargo test