-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (73 loc) · 2.16 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
84
85
86
87
name: Server test
on:
pull_request:
push:
branches:
- master
jobs:
test:
name: test
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-22.04]
services:
postgres:
image: postgres:13
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: nittei
ports:
- 5432:5432
env:
# Needed for sqlx
DATABASE_URL: postgresql://postgres:postgres@localhost/nittei
NITTEI__HTTP_PORT: 5000
NITTEI__DATABASE_URL: postgresql://postgres:postgres@localhost/nittei
RUST_BACKTRACE: 1
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: rustfmt
- uses: dtolnay/rust-toolchain@stable
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
# Install Nextest
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Run migrations
run: |
# run the migrations first
cargo install sqlx-cli --no-default-features --features postgres || true
(cd crates/infra && sqlx migrate run)
- name: Formatting
run: |
cargo +nightly fmt --all -- --check
- name: Clippy
run: |
cargo clippy --all
# To re-enable
# cargo clippy --all -- --deny "warnings"
# Commented out for now as it's pretty slow in the CI
# TODO: find a solution (e.g. by using caching) or re-enable only on master
# - name: Unused dependencies
# run: |
# cargo install cargo-udeps --locked
# cargo +nightly udeps --all-targets
# - name: Outdated dependencies
# run: |
# # cargo outdated --exit-code 1 --workspace
# cargo outdated --workspace
- name: Run server tests
run: |
cargo test --workspace -- --skip export_bindings_