-
Notifications
You must be signed in to change notification settings - Fork 0
241 lines (203 loc) · 7.2 KB
/
Copy pathe2e.yml
File metadata and controls
241 lines (203 loc) · 7.2 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
name: E2E Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
playwright:
name: Playwright Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Build CLI
run: go build -o guix ./cmd/guix
- name: Generate and build counter example
run: |
./guix generate -p examples/counter --verbose-logs
cd examples/counter
# Copy wasm_exec.js from Go installation
GOROOT="$(go env GOROOT)"
# Try lib/wasm first (Go 1.24+), then misc/wasm (older versions)
if [ -f "$GOROOT/lib/wasm/wasm_exec.js" ]; then
cp "$GOROOT/lib/wasm/wasm_exec.js" .
elif [ -f "$GOROOT/misc/wasm/wasm_exec.js" ]; then
cp "$GOROOT/misc/wasm/wasm_exec.js" .
else
echo "wasm_exec.js not found in GOROOT, downloading from GitHub"
curl -o wasm_exec.js https://raw.githubusercontent.com/golang/go/go1.25.0/lib/wasm/wasm_exec.js
fi
GOOS=js GOARCH=wasm go build -o main.wasm .
echo "Files after build:"
ls -lah *.{html,js,wasm,go} 2>/dev/null || ls -lah
- name: Install Playwright
working-directory: examples/counter
run: |
npm init -y
npm install -D @playwright/test
npx playwright install --with-deps chromium
- name: Run Playwright tests
working-directory: examples/counter
run: npx playwright test
- name: Upload test results and videos
if: always()
uses: actions/upload-artifact@v4
with:
name: counter-playwright-results
path: examples/counter/test-results/
retention-days: 7
calculator:
name: Calculator E2E Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Build CLI
run: go build -o guix ./cmd/guix
- name: Generate and build calculator example
run: |
./guix generate -p examples/calculator --verbose-logs
cd examples/calculator
# Copy wasm_exec.js from Go installation
GOROOT="$(go env GOROOT)"
if [ -f "$GOROOT/lib/wasm/wasm_exec.js" ]; then
cp "$GOROOT/lib/wasm/wasm_exec.js" .
elif [ -f "$GOROOT/misc/wasm/wasm_exec.js" ]; then
cp "$GOROOT/misc/wasm/wasm_exec.js" .
else
echo "wasm_exec.js not found in GOROOT, downloading from GitHub"
curl -o wasm_exec.js https://raw.githubusercontent.com/golang/go/go1.25.0/lib/wasm/wasm_exec.js
fi
GOOS=js GOARCH=wasm go build -o main.wasm .
echo "Files after build:"
ls -lah *.{html,js,wasm} 2>/dev/null || ls -lah
- name: Install Playwright
working-directory: examples/calculator
run: |
npm install
npx playwright install --with-deps chromium
- name: Run Playwright tests
working-directory: examples/calculator
run: npx playwright test
- name: Upload test results and videos
if: always()
uses: actions/upload-artifact@v4
with:
name: calculator-playwright-results
path: examples/calculator/test-results/
retention-days: 7
webgpu-cube:
name: WebGPU Cube E2E Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Build WebGPU cube example
run: |
cd examples/webgpu-cube
# Copy wasm_exec.js from Go installation
GOROOT="$(go env GOROOT)"
if [ -f "$GOROOT/lib/wasm/wasm_exec.js" ]; then
cp "$GOROOT/lib/wasm/wasm_exec.js" .
elif [ -f "$GOROOT/misc/wasm/wasm_exec.js" ]; then
cp "$GOROOT/misc/wasm/wasm_exec.js" .
else
echo "wasm_exec.js not found in GOROOT, downloading from GitHub"
curl -o wasm_exec.js https://raw.githubusercontent.com/golang/go/go1.25.0/lib/wasm/wasm_exec.js
fi
# Build WASM
GOOS=js GOARCH=wasm go build -o main.wasm .
echo "Files after build:"
ls -lah *.{html,js,wasm} 2>/dev/null || ls -lah
- name: Install Playwright
working-directory: examples/webgpu-cube
run: |
npm install
npx playwright install --with-deps chromium
- name: Run WebGPU tests
working-directory: examples/webgpu-cube
run: npx playwright test
- name: Upload test results, videos, and screenshots
if: always()
uses: actions/upload-artifact@v4
with:
name: webgpu-cube-test-artifacts
path: |
examples/webgpu-cube/test-results/
examples/webgpu-cube/tests/**/*-snapshots/
retention-days: 7
webgpu-chart:
name: WebGPU Chart E2E Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Build CLI
run: go build -o guix ./cmd/guix
- name: Generate and build WebGPU chart example
run: |
# Generate Guix components
./guix generate -p examples/webgpu-chart --verbose-logs
cd examples/webgpu-chart
# Copy wasm_exec.js from Go installation
GOROOT="$(go env GOROOT)"
if [ -f "$GOROOT/lib/wasm/wasm_exec.js" ]; then
cp "$GOROOT/lib/wasm/wasm_exec.js" .
elif [ -f "$GOROOT/misc/wasm/wasm_exec.js" ]; then
cp "$GOROOT/misc/wasm/wasm_exec.js" .
else
echo "wasm_exec.js not found in GOROOT, downloading from GitHub"
curl -o wasm_exec.js https://raw.githubusercontent.com/golang/go/go1.25.0/lib/wasm/wasm_exec.js
fi
# Build WASM
GOOS=js GOARCH=wasm go build -o main.wasm .
echo "Files after build:"
ls -lah *.{html,js,wasm} 2>/dev/null || ls -lah
- name: Install Playwright
working-directory: examples/webgpu-chart
run: |
npm install
npx playwright install --with-deps chromium
- name: Run WebGPU chart tests
working-directory: examples/webgpu-chart
run: npx playwright test
- name: Upload test results, videos, and screenshots
if: always()
uses: actions/upload-artifact@v4
with:
name: webgpu-chart-test-artifacts
path: |
examples/webgpu-chart/test-results/
examples/webgpu-chart/tests/**/*-snapshots/
retention-days: 7