Add ci workflow

This commit is contained in:
Rob Wagner 2024-05-13 18:40:02 -04:00
parent c673414685
commit a81dff414c
No known key found for this signature in database
GPG key ID: 53CCB4497B15CF61

49
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,49 @@
name: ci
env:
CARGO_TERM_COLOR: always
on:
push:
branches:
- main
pull_request: {}
jobs:
check:
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- name: run clippy
run: cargo clippy --all-features -- -D warnings
- name: run formatter checks
run: cargo fmt --all --check
test:
needs: check
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- uses: Swatinem/rust-cache@v2
- name: run tests
run: cargo test --all-features