Skip to content

Add github workflow

Add github workflow #5

Workflow file for this run

name: CI
on:
push:
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -Dwarnings
jobs:
fmt:
name: Format
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: checkout
uses: actions/checkout@v4
- name: install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: cargo fmt
run: cargo fmt --all --check
clippy:
name: Clippy
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: checkout
uses: actions/checkout@v4
- name: install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: cargo clippy
run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic
tests:
name: Tests ${{matrix.rust}}
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable, beta, nightly, 1.78.0]
timeout-minutes: 15
steps:
- name: checkout
uses: actions/checkout@v4
- name: install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
- name: cargo check
run: cargo check --all-targets
- name: cargo test
run: cargo test