-
Notifications
You must be signed in to change notification settings - Fork 111
62 lines (52 loc) · 1.59 KB
/
build-and-test-core.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
name: Lint & Build & Test (core)
on:
push:
paths:
- core/**
- .github/workflows/build-and-test-core.yml
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Install minimal stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: checkout
uses: actions/checkout@v3
- name: Install Redis
uses: zhulik/[email protected]
with:
redis version: "7.2.5"
- name: Install Postgres
uses: harmon758/postgresql-action@v1
with:
postgresql version: "14.13" # See https://hub.docker.com/_/postgres for available versions
postgresql db: oauth
postgresql user: test
postgresql password: test
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: core
- name: Lint
working-directory: core
run: cargo fmt --all -- --check
- name: Setup Tables
working-directory: core
run: cargo run --bin init_db
env:
OAUTH_DATABASE_URI: "postgres://test:test@localhost:5432/oauth"
- name: Test
working-directory: core
run: cargo test --all
env:
DISABLE_API_KEY_CHECK: "true"
OAUTH_DATABASE_URI: "postgres://test:test@localhost:5432/oauth"
REDIS_URI: "redis://localhost:6379"
OAUTH_ENCRYPTION_KEY: ${{ secrets.TEST_OAUTH_ENCRYPTION_KEY }}