-
Notifications
You must be signed in to change notification settings - Fork 178
190 lines (169 loc) · 6.07 KB
/
Copy pathweb-test-e2e.yml
File metadata and controls
190 lines (169 loc) · 6.07 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
name: End-to-end tests of web+runtime
on:
pull_request:
paths:
- ".github/workflows/web-test-e2e.yml"
- "admin/**"
- "cli/**"
- "runtime/**"
- "web-admin/**"
- "web-common/**"
- "web-local/**"
workflow_dispatch:
inputs:
browser:
type: choice
options:
- "chrome"
- "safari"
- "firefox"
- "all"
default: "chrome"
description: "Choose which browser to test"
jobs:
setup:
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Filter modified codepaths
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
admin:
- ".github/workflows/web-test-e2e.yml"
- "admin/**"
- "cli/**"
- "runtime/**"
- "web-admin/**"
local:
- ".github/workflows/web-test-e2e.yml"
- "cli/**"
- "runtime/**"
- "web-local/**"
common:
- ".github/workflows/web-test-e2e.yml"
- "cli/**"
- "runtime/**"
- "web-common/**"
- name: Evaluate e2e tests matrix
id: matrix
run: |
echo "matrix=$(jq -n '[
("web-admin" | select(env.FILTER_ADMIN == "true" or env.FILTER_COMMON == "true")),
("web-local" | select(env.FILTER_LOCAL == "true" or env.FILTER_COMMON == "true")),
("web-integration" | select(env.FILTER_LOCAL == "true" or env.FILTER_ADMIN == "true" or env.FILTER_COMMON == "true"))
]' | jq -c)" >> "$GITHUB_OUTPUT"
env:
FILTER_ADMIN: ${{ steps.filter.outputs.admin }}
FILTER_COMMON: ${{ steps.filter.outputs.common }}
FILTER_LOCAL: ${{ steps.filter.outputs.local }}
e2e:
runs-on: ubuntu-22.04
needs: setup
strategy:
fail-fast: false
matrix:
name: ${{ fromJson(needs.setup.outputs.matrix) }}
env:
RILL_ADMIN_FRONTEND_URL: http://localhost:3000
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up NodeJS
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: NPM Install
run: npm ci
- name: Set up go for E2E
uses: actions/setup-go@v5
with:
go-version: 1.25
- name: Build and embed static UI
if: matrix.name != 'web-admin'
run: PLAYWRIGHT_TEST=true make cli
- name: Build rill cli only
if: matrix.name == 'web-admin'
run: PLAYWRIGHT_TEST=true make cli-only
- name: Install duckdb extensions
run: ./rill runtime install-duckdb-extensions
- name: Add CLI binary to PATH
run: echo "$GITHUB_WORKSPACE" >> $GITHUB_PATH
- name: Install browser for UI tests
run: |
npx playwright@^1.50.1 install
# For pull requests, always use chrome
if [ "${{ github.event_name }}" == "pull_request" ]; then
npx playwright install-deps chrome
# For manual workflow runs, use the selected browser
elif [ "${{ github.event.inputs.browser }}" == "all" ]; then
npx playwright install-deps
elif [ "${{ github.event.inputs.browser }}" == "chrome" ]; then
npx playwright install-deps chrome
elif [ "${{ github.event.inputs.browser }}" == "safari" ]; then
npx playwright install-deps safari
elif [ "${{ github.event.inputs.browser }}" == "firefox" ]; then
npx playwright install-deps firefox
else
echo "Invalid browser choice: ${{ github.event.inputs.browser }}"
exit 1
fi
- name: Authenticate GCloud
uses: google-github-actions/auth@v2
if: (matrix.name == 'web-admin' || matrix.name == 'web-integration')
with:
credentials_json: "${{ secrets.RILL_BINARY_SA }}"
- name: Set up GCloud SDK
if: (matrix.name == 'web-admin' || matrix.name == 'web-integration')
uses: google-github-actions/setup-gcloud@v2
- name: Test web-local
if: matrix.name == 'web-local'
run: |-
# For pull requests, always use chrome
if [ "${{ github.event_name }}" == "pull_request" ]; then
npm run test:chrome -w web-local
# For manual workflow runs, use the selected browser
elif [ "${{ github.event.inputs.browser }}" == "all" ]; then
npm run test:all -w web-local
elif [ "${{ github.event.inputs.browser }}" == "chrome" ]; then
npm run test:chrome -w web-local
elif [ "${{ github.event.inputs.browser }}" == "safari" ]; then
npm run test:safari -w web-local
elif [ "${{ github.event.inputs.browser }}" == "firefox" ]; then
npm run test:firefox -w web-local
else
echo "Invalid browser choice: ${{ github.event.inputs.browser }}"
exit 1
fi
- name: Test web-admin
if: matrix.name == 'web-admin'
run: |-
npm run build -w web-admin
npm run test -w web-admin
- name: Test web-integration
if: matrix.name == 'web-integration'
run: |-
npm run test -w web-integration
- uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ matrix.name }}-playwright-report
path: ${{ matrix.name }}/playwright-report/
retention-days: 30
- uses: actions/upload-artifact@v4
if: always() && matrix.name == 'web-admin'
with:
name: web-admin-services-log
path: web-admin/playwright/logs/admin-runtime.log
retention-days: 30
- uses: actions/upload-artifact@v4
if: always() && matrix.name == 'web-integration'
with:
name: web-integration-services-log
path: web-integration/playwright/logs/admin-runtime.log
retention-days: 30