-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (40 loc) · 1.08 KB
/
tests.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
name: Node.js CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
tests:
runs-on: ubuntu-latest
services:
postgresql:
image: postgres:15.3-alpine
env:
POSTGRES_DB: poduptime
POSTGRES_USER: lambda
POSTGRES_PASSWORD: secret
POSTGRES_INITDB_ARGS: "--locale=en_US.UTF-8"
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '20.x'
- run: npm ci
working-directory: ./monitor
- run: npm ci
working-directory: ./analytics
- run: psql -d postgresql://lambda@localhost/poduptime -f deployment/database/schema.sql
working-directory: ./analytics
env:
PGPASSWORD: secret
- run: npm run test
env:
PGDATABASE: poduptime
PGUSER: lambda
PGHOST: localhost
PGPORT: 5432
PGPASSWORD: secret