-
Notifications
You must be signed in to change notification settings - Fork 17
90 lines (76 loc) · 2.67 KB
/
codegen-e2e.yml
File metadata and controls
90 lines (76 loc) · 2.67 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
name: Codegen E2E Tests
# Tests the btst init CLI codegen experience from scratch:
# shadcn init → btst init → copy E2E overlay files → build → run Playwright
#
# The codegen-projects/ directory is never committed — it is always built
# fresh from scripts/codegen/setup-{framework}.sh in each CI run.
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'packages/cli/**'
- 'packages/stack/**'
- 'packages/ui/**'
- 'scripts/codegen/**'
- 'e2e/**'
- '.github/workflows/codegen-e2e.yml'
jobs:
codegen-e2e:
name: Codegen E2E (${{ matrix.framework }})
runs-on: ubuntu-latest
concurrency:
group: codegen-e2e-${{ matrix.framework }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
NODE_OPTIONS: --max-old-space-size=8192
strategy:
fail-fast: false
matrix:
framework: [nextjs, react-router, tanstack]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PNPM
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install monorepo dependencies
run: pnpm install
- name: Build workspace
run: pnpm -w build
# Creates codegen-projects/${{ matrix.framework }}/ from scratch:
# 1. shadcn init (framework + Nova preset)
# 2. btst init (all plugins, memory adapter)
# 3. pnpm dlx shadcn add (extra UI components)
# 4. Copy E2E overlay files from scripts/codegen/files/${{ matrix.framework }}/
# 5. pnpm install
- name: Set up ${{ matrix.framework }} codegen project from scratch
run: bash scripts/codegen/setup-${{ matrix.framework }}.sh
timeout-minutes: 20
- name: Install Playwright browsers
run: cd e2e && pnpm exec playwright install --with-deps
- name: Run codegen E2E tests (${{ matrix.framework }})
run: pnpm -F e2e codegen:e2e:${{ matrix.framework }}
- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report-codegen-${{ matrix.framework }}
path: e2e/playwright-report-codegen
if-no-files-found: ignore
- name: Upload failure traces
if: failure()
uses: actions/upload-artifact@v4
with:
name: traces-codegen-${{ matrix.framework }}
path: test-results-codegen/**/*.zip
if-no-files-found: ignore