add ci #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
fmt: | |
name: stable / fmt | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust stable | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt | |
- name: Run cargo fmt | |
run: cargo fmt -- --check | |
- name: Cache Cargo dependencies | |
uses: Swatinem/rust-cache@v2 | |
clippy_check: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust stable with Clippy | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
- name: Run Clippy | |
run: cargo clippy --all-features -- -D warnings |