-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (43 loc) · 1.08 KB
/
test-run.yml
File metadata and controls
53 lines (43 loc) · 1.08 KB
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
name: Build & Test
on:
pull_request:
branches: [ '*' ]
workflow_call:
workflow_dispatch:
jobs:
test-run:
runs-on: ubuntu-latest
services:
postgres:
image: "postgres:13"
ports:
- "5432:5432"
env:
POSTGRES_USER: testuser
POSTGRES_PASSWORD: testpwd
POSTGRES_DB: coal
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
PRISMA_DB_URL: postgresql://testuser:testpwd@localhost:5432/coal
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Install dependencies
run: npm install
- name: Build Typescript app
run: npm run build
- name: Build database
run: npx prisma migrate deploy
- name: Test Docker build
run: docker compose build
# TODO: Add tests here. Requires a mock database.