Repository navigation
132 lines (113 loc) · 4.73 KB
/
Copy pathweb.yml
File metadata and controls
132 lines (113 loc) · 4.73 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Web
on:
pull_request:
paths:
- "apps/web/**"
- "packages/**"
- "pnpm-lock.yaml"
- "turbo.json"
- ".github/workflows/web.yml"
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: hackkit
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres -d hackkit"
--health-interval 10s
--health-timeout 5s
--health-retries 5
mysql:
image: mysql:8.4
env:
MYSQL_ROOT_PASSWORD: mysql
MYSQL_DATABASE: hackkit
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping -h 127.0.0.1 -pmysql"
--health-interval 10s
--health-timeout 5s
--health-retries 10
libsql:
image: ghcr.io/tursodatabase/libsql-server:latest
env:
SQLD_NODE: standalone
SQLD_HTTP_LISTEN_ADDR: 0.0.0.0:8080
ports:
- 8080:8080
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22.17.0"
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build web dependency graph
run: pnpm exec turbo run build --filter=web^...
- name: Sync plugin files
working-directory: apps/web
run: pnpm plugin:sync
- name: Verify generated plugin files are current
run: git diff --exit-code -- apps/web/app apps/web/hackkit.lock
- name: Wait for network libSQL
run: curl --fail --retry 20 --retry-connrefused --retry-delay 2 http://127.0.0.1:8080/health
- name: Test all SQL drivers against committed migrations
env:
HACKKIT_REQUIRE_DATABASE_MATRIX: "1"
HACKKIT_TEST_POSTGRESQL_URL: postgresql://postgres:postgres@127.0.0.1:5432/hackkit
HACKKIT_TEST_MYSQL_URL: mysql://root:mysql@127.0.0.1:3306/hackkit
HACKKIT_TEST_LIBSQL_URL: http://127.0.0.1:8080
run: pnpm --filter web test:db-matrix
- name: Test database workflow isolation
run: pnpm --filter web test:db-workflow
- name: Package tests
run: |
pnpm --filter web test
pnpm --filter @hackkit/core test
pnpm --filter @hackkit/cli test
pnpm --filter @hackkit/config test
pnpm --filter @hackkit/next test
pnpm --filter @hackkit/plugin-teams test
pnpm --filter @hackkit/plugin-discord test
pnpm --filter @hackkit/plugin-notifications-email test
- name: Prepare isolated build database
env:
DATABASE_URL: file:.data/ci.db
run: |
mkdir -p apps/web/.data
pnpm --filter web db:migrate
pnpm --filter web db:seed
- name: Typecheck
run: pnpm --filter web typecheck
- name: Build web
env:
DATABASE_URL: file:.data/ci.db
NEXT_PUBLIC_APP_URL: https://web-ci.example.com
BETTER_AUTH_URL: https://web-ci.example.com
BETTER_AUTH_SECRET: ci-web-secret-that-is-at-least-32-characters
HACKKIT_BLOB_ADAPTER: s3
HACKKIT_S3_BUCKET: ci-bucket
HACKKIT_S3_REGION: auto
HACKKIT_S3_ENDPOINT: https://example.r2.cloudflarestorage.com
HACKKIT_S3_ACCESS_KEY_ID: ci-access-key
HACKKIT_S3_SECRET_ACCESS_KEY: ci-secret-key
DISCORD_GUILD_ID: ci-guild
DISCORD_BOT_API_URL: https://discord-bot-ci.example.com
DISCORD_INTERNAL_AUTH_KEY: ci-internal-auth-key
DISCORD_PARTICIPANT_ROLE_ID: ci-participant-role
run: pnpm --filter web build
- name: Test production HTTP runtime
run: pnpm --filter web test:runtime