-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (51 loc) · 1.51 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
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: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.toolchain}}
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