-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (54 loc) · 1.48 KB
/
build.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
name: Build
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
env:
CARGO_TERM_COLOR: always
jobs:
build-rs:
name: Build and Lint Rust Code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Setup Postgres
uses: harmon758/postgresql-action@v1
with:
postgresql version: '15'
postgresql user: 'rewards'
postgresql password: 'alien'
- name: Setup sqlx
run: |
echo "DATABASE_URL=postgres://rewards:alien@localhost/rewards" >> .env
cargo install sqlx-cli --version 0.6.3 --locked --no-default-features --features native-tls,postgres
sqlx database setup
- name: Build
run: cargo build --locked
- name: Lint
run: cargo clippy --locked
build-js:
name: Build and Lint JS Code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
cache-dependency-path: web/package-lock.json
- name: Install Dependencies
working-directory: web
run: npm ci
- name: Build
working-directory: web
run: npm run build
- name: Lint
working-directory: web
run: npm run lint