-
Notifications
You must be signed in to change notification settings - Fork 13
41 lines (37 loc) · 1.01 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
name: Rust
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_DB: test_db
POSTGRES_PASSWORD: test_password
POSTGRES_USER: test_user
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run clippy
run: |
cargo clippy --verbose
cargo clippy --tests --verbose
- name: Prepare database
run: |
sudo apt-get install -y postgresql-client
PGPASSWORD=test_password psql -h localhost -U test_user test_db < testdata/database-setup.sql
- name: Run tests
run: TEST_DATABASE_URL="postgresql://test_user:test_password@localhost/test_db" cargo test --verbose -- --test-threads=1