Add CI tests

A cached setup that includes cargo check, clippy, fmt, and test

Signed-off-by: Evan Lloyd New-Schmidt <evan@new-schmidt.com>
This commit is contained in:
Evan Lloyd New-Schmidt 2023-05-30 16:34:44 -04:00
parent 5991270650
commit c38870a3a0

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

@ -0,0 +1,33 @@
name: Continuous Integration
on: [push, pull_request]
jobs:
test:
strategy:
fail-fast: false
name: cargo check/clippy/fmt/test
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
steps:
- uses: actions/checkout@v3
- run: rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@v2
with:
# bump this to invalidate build/dependency cache
prefix-key: "v0-rust"
- name: Check compilation
run: cargo check --verbose --locked
- name: Lint
run: cargo clippy
- name: Test
run: cargo test --verbose --locked
- name: Formatting
run: cargo fmt --verbose --check