Skip to content

Split linting and formatting CI jobs #25

Split linting and formatting CI jobs

Split linting and formatting CI jobs #25

Workflow file for this run

name: Glazed CI
on:
push:
branches:
- main
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: rustfmt
- name: Check formatting
# Use nightly for formatting to enable unstable formatting styles
# * group imports
# * import_granularity
run: cargo +nightly fmt -- --check
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Clippy
run: |
cargo --version
cargo clippy --version
cargo clippy --all-targets --all-features -- --deny warnings
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
- name: Build Everything
run: cargo build --all-targets
- name: Run tests
run: cargo test --all-targets --verbose
# Ensure that no files (most likely the Cargo.lock file) have changed
- name: Unstaged Changes
run: git diff --exit-code