-
Notifications
You must be signed in to change notification settings - Fork 730
72 lines (60 loc) · 1.6 KB
/
Copy pathserver-tests.yml
File metadata and controls
72 lines (60 loc) · 1.6 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Server Tests
on:
pull_request:
# Only trigger when relevant files change to save CI minutes
paths-ignore:
- 'frontend/**'
- '**.md'
- '.gitignore'
- '.editorconfig'
- '**/.eslintrc*'
- '.prettierrc'
- '.prettierignore'
- 'LICENSE'
# Automatically cancel in-progress runs if you push new code to the same PR
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
image: postgres:14-alpine
command: postgres -c wal_level=logical
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: example
POSTGRES_DB: postgres
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 2s
--health-timeout 5s
--health-retries 15
env:
NODE_ENV: test
DB_HOST: localhost
DB_PORT: 5432
DB_USER: postgres
DB_PASSWORD: example
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm i --frozen-lockfile
- name: Prepare test database
run: ./.github/scripts/prepare-test-template-db.sh
- name: Run server tests
run: pnpm test:server