-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (53 loc) · 1.54 KB
/
Copy pathrust.yml
File metadata and controls
65 lines (53 loc) · 1.54 KB
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
name: Rust
on:
push:
paths:
- server/**
- .github/workflows/rust.yml
pull_request:
paths:
- server/**
defaults:
run:
working-directory: server
jobs:
ci:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12
env:
POSTGRES_USER: holostats
POSTGRES_PASSWORD: holostats
POSTGRES_DB: holostats
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Initialize database
run: |
psql postgres://holostats:holostats@localhost/holostats -f sql/schema.sql -f sql/initial.sql
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Cache target/
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Format
run: cargo fmt -- --check
- name: Create holostats.toml
run: mv holostats.example.toml holostats.toml
- name: Run Test
run: |
psql postgres://holostats:holostats@localhost/holostats -f sql/test.sql
cargo test
env:
DATABASE_URL: postgres://holostats:holostats@localhost/holostats