-
Notifications
You must be signed in to change notification settings - Fork 5
57 lines (55 loc) · 1.68 KB
/
rust.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
name: Lint & Test
on:
pull_request:
types: [opened, edited, reopened, synchronize]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13-alpine
# volumes:
# - ${{ github.workspace }}/schema:/docker-entrypoint-initdb.d
ports:
- 5432:5432
env:
POSTGRES_USER: username
POSTGRES_PASS: pass
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: relay
# POSTGRES_MULTIPLE_DATABASES: relay
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.platform }}-v1
- run: DATABASE_URL="postgres://username:pass@localhost:5432/relay?sslmode=disable" cargo test --all-features --all-targets
build:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.platform }}-v1
- run: cargo check --all-features --all-targets
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@clippy
- uses: Swatinem/rust-cache@v2
with:
key: ubuntu-latest-v1
- run: cargo clippy --all-features --tests -- -Dclippy::all -Dclippy::pedantic