-
Notifications
You must be signed in to change notification settings - Fork 4
41 lines (41 loc) · 1.1 KB
/
ci.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
name: CI
on: [push]
jobs:
ci:
name: CI
runs-on: ubuntu-latest
container: node:20.16.0-bookworm
services:
db:
image: postgres:15.5
env:
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Set up npm cache
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install Dependencies
run: npm ci
- name: Check Formatting
run: npm run format:check
- name: Run ESLint
run: npm run lint --workspaces
- name: Initialize database, set up .env, generate Prisma client
run: cd server; cp example.env .env; npm run test:db:reset
env:
DATABASE_URL: postgresql://postgres@db/app
- name: Run Tests
run: npm test
env:
DATABASE_URL: postgresql://postgres@db/app