-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (49 loc) · 1.5 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
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Rust
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build-server:
runs-on: ubuntu-latest
container: willsquire/diesel-cli
services:
postgres:
image: postgres
env:
POSTGRES_DB: wartid
POSTGRES_USER: wartid
POSTGRES_PASSWORD: wartid
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Test DB, install uuid-ossp, and interrupt action if it doesn't work
run: psql postgres://wartid:wartid@localhost/wartid --command='create extension "uuid-ossp";'
- uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v1
- name: Apply migrations
working-directory: ./wartid-server/
run: diesel migration run
env:
DATABASE_URL: postgres://wartid:wartid@localhost/wartid
- name: Build --all-features
working-directory: ./wartid-server/
run: cargo build --release --all-features --verbose
- name: Build --no-default-features
working-directory: ./wartid-server/
run: cargo build --release --no-default-features --verbose
- name: Run tests
working-directory: ./wartid-server/
run: cargo test --verbose
- uses: actions/upload-artifact@v3
with:
name: wartid-server
path: ./target/release/wartid-server