-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (53 loc) · 1.56 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
59
60
61
62
63
64
65
66
67
name: Rust
on:
push:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
ci:
name: Continuous Integration
runs-on: ubuntu-latest
strategy:
matrix:
toolchain: ["stable", "nightly"]
services:
postgres:
image: postgres
ports:
- 5432:5432
env:
POSTGRES_USER: sqlm-test
POSTGRES_DB: sqlm-test
POSTGRES_PASSWORD: sqlm-test
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DATABASE_URL: postgresql://sqlm-test:sqlm-test@localhost/sqlm-test
steps:
- name: Add build dependencies
run: sudo apt-get install libpq-dev libudev-dev
- name: Checkout code
uses: actions/checkout@v2
- name: Populate test database
run: psql $DATABASE_URL < postgres/testdb.sql
- name: Install ${{matrix.toolchain}} toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{matrix.toolchain}}
override: true
components: rustfmt, clippy
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Test
run: cargo hack test --workspace --feature-powerset --depth 2
- name: Clippy
run: cargo hack check --workspace --feature-powerset --depth 1
- name: Fmt
if: ${{ matrix.toolchain == 'nightly' }}
run: cargo fmt -- --check