-
Notifications
You must be signed in to change notification settings - Fork 120
63 lines (54 loc) · 1.62 KB
/
Copy pathapi-tests.yml
File metadata and controls
63 lines (54 loc) · 1.62 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
name: API Tests (Newman)
# Runs the DevCard Postman collection against a freshly-booted backend.
on:
pull_request:
paths:
- 'apps/backend/**'
- 'packages/shared/**'
- '.github/workflows/api-tests.yml'
workflow_dispatch:
jobs:
newman:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: devcard
POSTGRES_PASSWORD: devcard
POSTGRES_DB: devcard
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U devcard"
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DATABASE_URL: postgresql://devcard:devcard@localhost:5432/devcard
REDIS_URL: redis://localhost:6379
JWT_SECRET: ci-test-secret-not-for-production-ci-test-secret-not-for-production
ENCRYPTION_KEY: 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
NODE_ENV: development
PORT: '3000'
PUBLIC_APP_URL: http://localhost:5173
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Install shared dependencies
run: npm --prefix packages/shared install
- name: Install backend dependencies
run: npm --prefix apps/backend install
- name: Run API tests
run: bash ./.github/scripts/run-api-tests.sh