ci: add cache & code fmt check (#16) #11
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_LOG: info | |
RUST_BACKTRACE: 1 | |
CI: true | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install toolchain | |
uses: moonrepo/setup-rust@v1 | |
with: | |
components: clippy,rustfmt | |
cache-base: main | |
- name: Check formatting | |
run: cargo fmt --all --check | |
- name: Run Clippy | |
run: cargo clippy | |
- name: Run Build | |
run: cargo build | |
- name: Run tests | |
run: cargo test |