-
-
Notifications
You must be signed in to change notification settings - Fork 13
118 lines (94 loc) · 2.48 KB
/
check.yaml
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Check
on: [push]
jobs:
workspace:
name: Node Workspace
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install
run: npm install
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v4
with:
main-branch-name: 'master'
- name: Format check
run: npm run check:format
- name: Build
run: npm run build:affected
env:
CI: true
- name: Check
run: npm run check:affected
- name: Lint
run: npm run lint:affected
cargo:
name: Cargo Workspace
env:
CI: true
runs-on: ubuntu-latest
services:
redis:
image: redis
ports:
- '6379:6379'
postgres:
image: postgres:16
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: boluo
ports:
- '5432:5432'
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy
- name: Setup rust cache
uses: Swatinem/rust-cache@v2
- name: Build (Database Offline Mode)
run: cargo build
- name: Initialize database
run: cargo run --bin init
env:
DATABASE_URL: postgresql://postgres:postgres@localhost/boluo
- name: Clippy
run: cargo clippy
- name: Test
run: cargo test
env:
SECRET: SOME_SECRET
BOLUO_DEBUG: 1
PORT: 3000
- name: Build (Database Online Mode)
run: |
rm -rf .sqlx
cargo clean -p server
cargo build
env:
DATABASE_URL: postgresql://postgres:postgres@localhost/boluo
- name: Check
run: cargo run -p server -- --check
env:
SECRET: SOME_SECRET
DATABASE_URL: postgresql://postgres:postgres@localhost/boluo
REDIS_URL: redis://localhost/
PORT: 3000
CI: true
cargo-fmt:
name: Style (Rust)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy
- run: cargo fmt --all --check