-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (53 loc) · 1.55 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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