name: CI
on:
push:
branches: [main]
tags: ["*"]
pull_request:
paths-ignore:
- "docs/**"
- "**.md"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
lint:
name: lint (fmt + clippy)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - name: Install Rust
run: rustup toolchain install stable --profile minimal --component clippy,rustfmt && rustup default stable
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: lint-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
- run: cargo fmt --all -- --check
- run: cargo clippy --all-targets -- -D warnings
test:
name: test
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - name: Install Rust
run: rustup toolchain install stable --profile minimal && rustup default stable
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: test-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
- run: cargo test