make CI faster and more comprehensive (#207)

This commit is contained in:
Carson McManus 2023-06-23 13:46:55 -04:00 committed by GitHub
parent cbc46ad8eb
commit 4deff5f633
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,41 +2,29 @@ name: Lint, Build, Test
on: on:
push: push:
branches: [ master, main ] branches: [master, main]
pull_request: pull_request:
branches: [ master, main ] branches: [master, main]
env: env:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - run: rustup component add clippy rustfmt
- name: Build - uses: actions/checkout@v3
run: cargo build --workspace --verbose - name: Rust Cache
- name: Run tests uses: Swatinem/rust-cache@v2.2.1
run: cargo test --workspace --verbose - name: Check format
lint: run: cargo fmt --all -- --check
name: rustfmt - name: Check
runs-on: ubuntu-latest run: cargo check --verbose --all-targets --all-features
steps: - name: Clippy
- name: Checkout sources run: cargo clippy --workspace --no-deps --all-features --all-targets -- -D warnings
uses: actions/checkout@v2 - name: Validate documentation
run: cargo doc --workspace --no-deps --all-features
- name: Install stable toolchain - name: Run tests
uses: actions-rs/toolchain@v1 run: cargo test --verbose
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check