-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (56 loc) · 1.58 KB
/
build.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
on: push
jobs:
build_cache:
runs-on: ubuntu-latest
env:
RUSTC_FORCE_INCREMENTAL: 1
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/cache_cargo
- name: build
run: cargo build
working-directory: app
fmt:
runs-on: ubuntu-latest
needs: build_cache
steps:
- uses: actions/checkout@v3
- run: rustup component add rustfmt
- uses: ./.github/actions/cache_cargo
- name: fmt
run: cargo fmt --all -- --check
working-directory: app
clippy:
runs-on: ubuntu-latest
env:
RUSTC_FORCE_INCREMENTAL: 1
needs: build_cache
steps:
- uses: actions/checkout@v3
- run: rustup component add clippy
- uses: ./.github/actions/cache_cargo
- name: clippy
run: cargo clippy --all-targets --all-features -- -D warnings
working-directory: app
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
RUSTC_FORCE_INCREMENTAL: 1
needs: build_cache
steps:
- name: create database for test
run: PGPASSWORD=postgres psql -h localhost -U postgres -c "CREATE DATABASE test"
- uses: actions/checkout@v3
- uses: ./.github/actions/cache_cargo
- name: test
run: cargo test --all -- --nocapture
working-directory: app