-
Notifications
You must be signed in to change notification settings - Fork 72
58 lines (54 loc) · 1.35 KB
/
crate_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: pgmq-rs client crate CI workflow
defaults:
run:
shell: bash
working-directory: pgmq-rs/
on:
pull_request:
branches:
- main
paths:
- ".github/workflows/crate_ci.yml"
- "pgmq-rs/**"
push:
branches:
- main
jobs:
lint:
name: Run linters
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install minimal nightly with clippy and rustfmt
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Cargo format
run: cargo +nightly fmt --all --check
- name: Clippy
run: cargo clippy
tests:
name: Run tests
runs-on: ubuntu-22.04
needs: lint
env:
DATABASE_URL: "postgresql://postgres:postgres@0.0.0.0:5432/postgres"
steps:
- uses: actions/checkout@v4
- name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
- name: install dependencies
run: cargo install sqlx-cli
- name: run all tests
run: make test
- name: Migrations
# ensure migration cache is up to date
run: cargo sqlx prepare --check
- name: teardown
run: make test.cleanup