CI overhaul #10
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: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: Swatinem/rust-cache@v1 | |
- run: cargo clippy --all-features -- -D warnings | |
- run: cargo fmt -- --check | |
semver-checks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
id: toolchain | |
- run: rustup override set ${{steps.toolchain.outputs.name}} | |
- name: Run cargo-semver-checks | |
shell: bash | |
run: | | |
export CARGO_TERM_COLOR=always | |
cargo install cargo-semver-checks --locked | |
cargo semver-checks check-release | |
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@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
id: toolchain | |
if: matrix.rust == 'stable' | |
- run: rustup override set ${{steps.toolchain.outputs.name}} | |
if: matrix.rust == 'stable' | |
- uses: Swatinem/rust-cache@v1 | |
- run: cargo build --tests | |
- run: cargo test -- --nocapture --quiet |