forked from gitroomhq/postiz-app
-
-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (83 loc) · 2.89 KB
/
Copy pathbuild.yml
File metadata and controls
97 lines (83 loc) · 2.89 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
---
name: Build
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
node-version: ['22.12.0']
# The bootstrap / OAuth-consent suites refuse to run unless DATABASE_URL
# points at 127.0.0.1:15491 (or :15432) and REDIS_URL at 127.0.0.1:16391
# (or :16379) — they throw 'Use isolated local test services' otherwise,
# which used to fail this job on every push. These ports are deliberate:
# they match the disposable local services the suites were written against.
services:
postgres:
image: postgres:17
env:
POSTGRES_USER: crove
POSTGRES_PASSWORD: crove
POSTGRES_DB: crove_test
ports:
- 15491:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 10
redis:
image: redis:7.2
ports:
- 16391:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 10
env:
DATABASE_URL: postgresql://crove:crove@127.0.0.1:15491/crove_test
DATABASE_DIRECT_URL: postgresql://crove:crove@127.0.0.1:15491/crove_test
REDIS_URL: redis://127.0.0.1:16391
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Setup PNPM
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Install dependencies
run: pnpm install --frozen-lockfile=false
- name: Validate Beta deployment script and compose contract
run: pnpm run validate:beta-deploy
# The suites drive the real Prisma client, so the schema must exist in
# the throwaway database first. --skip-generate because the postinstall
# hook already generated the client. No --accept-data-loss: this is an
# empty database and the step must stay non-destructive.
- name: Push Prisma schema to the test database
run: pnpm exec prisma db push --skip-generate --schema libraries/nestjs-libraries/src/database/prisma/schema.prisma
- name: Test bootstrap / OAuth consent (jest)
# --runInBand: the suites share one database and create/delete rows by
# known ids, so they must not run concurrently against each other.
run: pnpm exec jest --config tests/bootstrap.jest.cjs --ci --passWithNoTests --runInBand
- name: Test frontend primitives (vitest)
run: pnpm run test:frontend
- name: Build applications
run: pnpm run build