Repository navigation
66 lines (53 loc) · 1.83 KB
/
Copy pathci.yml
File metadata and controls
66 lines (53 loc) · 1.83 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
name: CI
on:
push:
branches: [main, master]
pull_request:
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- name: Checkout
uses: actions/checkout@v4
# Bun is the package manager and the production runtime; the version comes
# from packageManager in package.json, the same Bun the image pins.
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version-file: package.json
# Node stays as the interpreter for the test tooling (vitest, tsc,
# node --test, Playwright), which ran on Node 24 before.
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 24
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build and unit tests
run: bun run check
- name: Validate schema fixtures
run: bun run schemas:validate
- name: API contract tests
run: bun run test:contract
- name: The site serves under Bun
# Port 3100 and stopped afterwards: Playwright's webServer below needs 3000.
run: |
cd apps/logicsrc-web
PORT=3100 bun --bun ../../node_modules/next/dist/bin/next start > /tmp/web.log 2>&1 &
pid=$!
for i in $(seq 1 60); do
code=$(curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:3100/ || true)
if [ "$code" = 200 ]; then echo "/ -> $code"; kill "$pid"; exit 0; fi
sleep 1
done
cat /tmp/web.log; kill "$pid" || true; exit 1
- name: Install Playwright browsers
run: bunx playwright install --with-deps chromium
- name: Playwright E2E
run: bun run test:e2e