-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (69 loc) · 1.85 KB
/
server-test.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Server test
on:
pull_request:
push:
branches:
- master
jobs:
test:
name: test
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-18.04]
services:
postgres:
image: postgres:13
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: nettuscheduler
ports:
- 5432:5432
env:
PORT: 5000
DATABASE_URL: postgresql://postgres:postgres@localhost/nettuscheduler
steps:
- name: Checkout repository
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
scheduler/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run migrations
run: |
cd scheduler
# run the migrations first
cargo install sqlx-cli --no-default-features --features postgres || true
(cd crates/infra && sqlx migrate run)
- name: Install nighly toolchain
run: |
rustup default nightly
# Go back to stable
rustup default stable
- name: Formatting
run: |
cd scheduler
cargo fmt --all -- --check
- name: Clippy
run: |
cd scheduler
cargo clippy --all -- --deny "warnings"
- name: Unused dependencies
run: |
cd scheduler
cargo install cargo-udeps --locked
cargo +nightly udeps --all-targets
# - name: Outdated dependencies
# run: |
# cd scheduler
# # cargo outdated --exit-code 1 --workspace
# cargo outdated --workspace
- name: Run server tests
run: |
cd scheduler
cargo test --all