-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (85 loc) · 2.79 KB
/
Copy pathtest.yml
File metadata and controls
106 lines (85 loc) · 2.79 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Test
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-verification:
name: Build Verification
runs-on: ubuntu-latest
container: node:24-alpine
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install pnpm
run: npm install -g pnpm@9
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build all packages
run: pnpm build
test-backend-unit:
name: Backend Unit Tests
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
container: node:24-alpine
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install pnpm
run: npm install -g pnpm@9
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build shared package
run: pnpm --filter @branchforge/shared build
- name: Run unit tests
run: cd apps/backend && pnpm test:unit
test-backend-integration:
name: Backend Integration Tests
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
container: node:24-alpine
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_DB: branchforge_test
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_password
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DATABASE_URL_TEST: "postgresql://test_user:test_password@postgres:5432/branchforge_test"
NODE_ENV: test
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install pnpm
run: npm install -g pnpm@9
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build shared package
run: pnpm --filter @branchforge/shared build
- name: Run test migrations
run: cd apps/backend && pnpm db:migrate:test
- name: Run integration tests
run: cd apps/backend && pnpm test:integration
test-frontend-unit:
name: Frontend Unit Tests
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
container: node:24-alpine
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install pnpm
run: npm install -g pnpm@9
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build shared package
run: pnpm --filter @branchforge/shared build
- name: Run frontend tests
run: cd apps/frontend && pnpm test