CI overhaul #12
Workflow file for this run
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, pull_request] | |
jobs: | |
test: | |
name: Test ${{ matrix.rust }} on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_PORT: 5432 | |
POSTGRES_HOST_AUTH_METHOD: trust | |
ports: | |
- 5432:5432 | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
rust: | |
- MSRV | |
- stable | |
steps: | |
- uses: actions/checkout@v4 | |
# If testing stable Rust, do so with the latest dependencies. | |
- uses: dtolnay/rust-toolchain@stable | |
id: toolchain | |
if: matrix.rust == 'stable' | |
- run: rustup override set ${{steps.toolchain.outputs.name}} | |
if: matrix.rust == 'stable' | |
- name: Remove lockfile to build with latest dependencies | |
run: rm Cargo.lock | |
if: matrix.rust == 'stable' | |
- uses: Swatinem/rust-cache@v1 | |
- run: cargo build --tests | |
- run: cargo test -- --nocapture --quiet | |
clippy-msrv: | |
name: Clippy (MSRV) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v1 | |
- run: cargo clippy --all-features -- -D warnings | |
- run: cargo fmt -- --check | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check formatting | |
run: cargo fmt --all -- --check |