2626 REGISTRY : ghcr.io
2727
2828jobs :
29+ build-and-compile :
30+ runs-on : ubuntu-24.04
31+ steps :
32+ - name : Define node version
33+ uses : actions/setup-node@v4
34+ with :
35+ node-version : 24
36+
37+ - name : Check out repository code
38+ uses : actions/checkout@v4
39+
40+ - uses : pnpm/action-setup@v4
41+ with :
42+ version : 11.5.0
43+ run_install : false
44+
45+ - name : Get pnpm store directory
46+ shell : bash
47+ run : |
48+ echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
49+
50+ - name : Setup pnpm cache
51+ uses : actions/cache@v4
52+ with :
53+ path : |
54+ ${{ env.STORE_PATH }}
55+ key : ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
56+ restore-keys : |
57+ ${{ runner.os }}-pnpm-store-
58+
59+ - name : Cache turbo build artifacts
60+ uses : actions/cache@v4
61+ with :
62+ path : |
63+ .turbo
64+ key : ${{ runner.os }}-turbo-${{ hashFiles('**/pnpm-lock.yaml', 'turbo.json') }}-${{ github.ref_name }}
65+ restore-keys : |
66+ ${{ runner.os }}-turbo-${{ hashFiles('**/pnpm-lock.yaml', 'turbo.json') }}-
67+ ${{ runner.os }}-turbo-
68+
69+ - name : Install dependencies
70+ run : pnpm install
71+
72+ - name : Build all packages and apps
73+ run : pnpm run --filter @klicker-uzh/prisma build:test && pnpm run build:test
74+ env :
75+ APP_SECRET : abcd
76+ DATABASE_URL : postgres://klicker-prod:klicker@localhost:5432/klicker-prod
77+ NODE_ENV : test
78+ REDIS_HOST : localhost
79+ REDIS_PASS : ' '
80+ REDIS_PORT : 6379
81+ REDIS_CACHE_HOST : localhost
82+ REDIS_CACHE_PORT : 6379
83+ REDIS_ASSESSMENT_PORT : 6379
84+ REDIS_ASSESSMENT_PASS : ' '
85+ REDIS_ASSESSMENT_HOST : localhost
86+ APP_ORIGIN_API : http://127.0.0.1:3000
87+ APP_ORIGIN_AUTH : http://127.0.0.1:3010
88+ APP_ORIGIN_LTI : http://127.0.0.1:4000
89+ APP_ORIGIN_PWA : http://127.0.0.1:3001
90+ APP_ORIGIN_MANAGE : http://127.0.0.1:3002
91+ APP_ORIGIN_CONTROL : http://127.0.0.1:3003
92+ APP_ORIGIN_ASSESSMENT_API : http://127.0.0.1:3000
93+ APP_ORIGIN_ASSESSMENT_PWA : http://127.0.0.1:3001
94+
95+ - name : Upload Playwright build outputs
96+ uses : actions/upload-artifact@v4
97+ with :
98+ name : playwright-build-artifact
99+ include-hidden-files : true
100+ path : |
101+ apps/auth/.next
102+ !apps/auth/.next/cache/**
103+ !apps/auth/.next/standalone/**
104+ apps/chat/.next
105+ !apps/chat/.next/cache/**
106+ !apps/chat/.next/standalone/**
107+ apps/frontend-control/.next
108+ !apps/frontend-control/.next/cache/**
109+ !apps/frontend-control/.next/standalone/**
110+ apps/frontend-manage/.next
111+ !apps/frontend-manage/.next/cache/**
112+ !apps/frontend-manage/.next/standalone/**
113+ apps/frontend-pwa/.next
114+ !apps/frontend-pwa/.next/cache/**
115+ !apps/frontend-pwa/.next/standalone/**
116+ apps/backend-docker/dist
117+ apps/hatchet-worker-general/dist
118+ apps/hatchet-worker-response-processor/dist
119+ apps/lti/dist
120+ apps/mcp-lecturer/dist
121+ apps/olat-api/dist
122+ apps/response-api/dist
123+ packages/export/dist
124+ packages/grading/dist
125+ packages/graphql/dist
126+ packages/hatchet/dist
127+ packages/markdown/dist
128+ packages/prisma/dist
129+ packages/types/dist
130+ packages/util/dist
131+ retention-days : 1
132+
29133 playwright-run :
134+ needs : build-and-compile
30135 runs-on : ubuntu-24.04
31136 container :
32137 image : mcr.microsoft.com/playwright:v1.58.2-noble
@@ -141,41 +246,18 @@ jobs:
141246 restore-keys : |
142247 ${{ runner.os }}-pnpm-store-
143248
144- - name : Cache turbo build artifacts
145- uses : actions/cache@v4
146- with :
147- path : |
148- .turbo
149- key : ${{ runner.os }}-turbo-${{ hashFiles('**/pnpm-lock.yaml', 'turbo.json') }}-${{ github.ref_name }}
150- restore-keys : |
151- ${{ runner.os }}-turbo-${{ hashFiles('**/pnpm-lock.yaml', 'turbo.json') }}-
152- ${{ runner.os }}-turbo-
153-
154249 - name : Install dependencies
155250 run : pnpm install
156251
157- - name : Build all packages and apps
158- run : pnpm run --filter @klicker-uzh/prisma build:test && pnpm run build:test
252+ - name : Download Playwright build outputs
253+ uses : actions/download-artifact@v4
254+ with :
255+ name : playwright-build-artifact
256+
257+ - name : Generate Prisma Client
258+ run : pnpm --filter @klicker-uzh/prisma generate
159259 env :
160- APP_SECRET : abcd
161260 DATABASE_URL : postgres://klicker-prod:klicker@postgres:5432/klicker-prod
162- NODE_ENV : test
163- REDIS_HOST : redis_exec
164- REDIS_PASS : ' '
165- REDIS_PORT : 6379
166- REDIS_CACHE_HOST : redis_cache
167- REDIS_CACHE_PORT : 6379
168- REDIS_ASSESSMENT_PORT : 6379
169- REDIS_ASSESSMENT_PASS : ' '
170- REDIS_ASSESSMENT_HOST : redis_assessment_exec
171- APP_ORIGIN_API : http://127.0.0.1:3000
172- APP_ORIGIN_AUTH : http://127.0.0.1:3010
173- APP_ORIGIN_LTI : http://127.0.0.1:4000
174- APP_ORIGIN_PWA : http://127.0.0.1:3001
175- APP_ORIGIN_MANAGE : http://127.0.0.1:3002
176- APP_ORIGIN_CONTROL : http://127.0.0.1:3003
177- APP_ORIGIN_ASSESSMENT_API : http://127.0.0.1:3000
178- APP_ORIGIN_ASSESSMENT_PWA : http://127.0.0.1:3001
179261
180262 - name : Prepare .env files
181263 run : |
@@ -200,11 +282,13 @@ jobs:
200282 timeout-minutes : 120
201283 run : |
202284 chmod +x .github/scripts/wait-for-services.sh
285+ TEST_FILES=$(node .github/scripts/get-shard-files.js ${{ matrix.shardIndex }})
286+ echo "Running tests for shard ${{ matrix.shardIndex }}: $TEST_FILES"
203287 .github/scripts/wait-for-services.sh -- \
204288 env NODE_ENV=test \
205289 pnpm --filter @klicker-uzh/playwright exec playwright test \
206290 --project=chromium \
207- --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
291+ $TEST_FILES
208292 env :
209293 APP_SECRET : abcd
210294 DATABASE_URL : postgres://klicker-prod:klicker@postgres:5432/klicker-prod
0 commit comments