-
Notifications
You must be signed in to change notification settings - Fork 169
249 lines (223 loc) · 8.5 KB
/
e2e-test.yml
File metadata and controls
249 lines (223 loc) · 8.5 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
242
243
244
245
246
247
248
249
name: E2E Test
permissions: {}
on:
workflow_dispatch:
schedule:
# Run every day at 0:00 GMT (8:00 AM Singapore time)
- cron: '0 0 * * *'
push:
branches:
- main
- deps/upstream-update
paths-ignore:
- '**/*.md'
pull_request:
paths:
- 'ecosystem-ci/**'
- '.github/workflows/e2e-test.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.sha }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
defaults:
run:
shell: bash
jobs:
download-previous-rolldown-binaries:
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ./.github/actions/download-rolldown-binaries
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
build:
name: Build vite-plus packages
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
needs:
- download-previous-rolldown-binaries
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ./.github/actions/clone
- name: Configure Git for access to vite-task
run: git config --global url."https://x-access-token:${{ secrets.VITE_TASK_TOKEN }}@github.com/".insteadOf "https://github.com/"
- uses: oxc-project/setup-rust@d286d43bc1f606abbd98096666ff8be68c8d5f57 # v1.0.0
with:
save-cache: ${{ github.ref_name == 'main' }}
cache-key: e2e-build
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: rolldown-binaries
path: ./rolldown/packages/rolldown/src
merge-multiple: true
- name: Build with upstream
uses: ./.github/actions/build-upstream
with:
target: x86_64-unknown-linux-gnu
- name: Pack packages into tgz
run: |
pnpm run bootstrap-cli:ci
mkdir -p tmp/tgz
cd packages/core && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
cd packages/test && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
cd packages/cli && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
cd packages/global && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
ls -la tmp/tgz
- name: Upload tgz artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: vite-plus-packages
path: tmp/tgz/*.tgz
retention-days: 1
e2e-test:
name: ${{ matrix.project.name }} E2E test
env:
# For packing manager install from github package registry
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: read
packages: read
needs:
- build
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
project:
- name: vibe-dashboard
node-version: 24
command: |
npx playwright install chromium
# FIXME: Failed to load JS plugin: ./plugins/debugger.js
# vite run ready
vite fmt
vite test
vite run build
# FIXME: TypeError: Failed to fetch dynamically imported module
# - name: skeleton
# node-version: 24
# command: |
# vite run format
# vite run lint:check
# vite run check
# npx playwright install chromium
# vite run test
- name: rollipop
node-version: 22
command: |
vite run -r build
# FIXME: typescript-eslint(no-redundant-type-constituents): 'rolldownExperimental.DevEngine' is an 'error' type that acts as 'any' and overrides all other types in this union type.
vite run lint || true
# FIXME: src/bundler-pool.ts(8,8): error TS2307: Cannot find module '@rollipop/core' or its corresponding type declarations.
vite run -r typecheck || true
vite run format
vite run @rollipop/common#test
vite run @rollipop/core#test
vite run @rollipop/dev-server#test
- name: frm-stack
node-version: 24
command: |
vite run lint:check
vite run format:check
vite run typecheck
vite run @yourcompany/api#test
vite run @yourcompany/backend-core#test
- name: vue-mini
node-version: 24
command: |
vite run format
vite run lint
vite run type
vite run test -- --coverage
- name: vite-plugin-react
node-version: 22
command: |
vite run format
vite run lint -- --fix
# TODO(fengmk2): run all builds and tests after tsdown version upgrade
vite run @vitejs/plugin-rsc#build
vite run @vitejs/plugin-rsc#test
- name: vitepress
node-version: 24
command: |
npx playwright install chromium
vite run format
vite run build
vite test run -r __tests__/unit
vite run tests-e2e#test
VITE_TEST_BUILD=1 vite run tests-e2e#test
vite run tests-init#test
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ./.github/actions/clone
with:
ecosystem-ci-project: ${{ matrix.project.name }}
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
with:
node-version: ${{ matrix.project.node-version }}
package-manager-cache: false
- name: Download vite-plus packages
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: vite-plus-packages
path: tmp/tgz
- name: Install vite-plus from tgz in ${{ matrix.project.name }}
working-directory: ecosystem-ci/${{ matrix.project.name }}
run: |
# install global CLI first
npm install -g ../../tmp/tgz/voidzero-dev-global-0.0.0.tgz
# avoid the vite migration using the wrong ignore file
rm -f ../.gitignore
node ../patch-project.ts ${{ matrix.project.name }}
vite install --no-frozen-lockfile
- name: Run vite-plus commands in ${{ matrix.project.name }}
working-directory: ecosystem-ci/${{ matrix.project.name }}
run: ${{ matrix.project.command }}
notify-failure:
name: Notify on failure
runs-on: ubuntu-latest
needs: e2e-test
if: ${{ failure() && github.event_name == 'schedule' }}
permissions:
contents: read
issues: write
steps:
- name: Create or update GitHub issue on failure
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
run: |
ISSUE_TITLE="E2E Test Scheduled Run Failed"
ISSUE_LABEL="e2e-failure"
RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
# Create label if it doesn't exist
if ! gh label list --json name --jq '.[].name' | grep -q "^${ISSUE_LABEL}$"; then
gh label create "$ISSUE_LABEL" --color "d73a4a" --description "E2E test scheduled run failure"
echo "Created label: $ISSUE_LABEL"
fi
# Search for existing open issue with the label
EXISTING_ISSUE=$(gh issue list --label "$ISSUE_LABEL" --state open --json number --jq '.[0].number')
if [ -z "$EXISTING_ISSUE" ]; then
# Create new issue if none exists
gh issue create \
--title "$ISSUE_TITLE" \
--label "$ISSUE_LABEL" \
--body "The scheduled E2E test run has failed.
**Failed Run:** $RUN_URL
**Time:** $(date -u '+%Y-%m-%d %H:%M:%S UTC')
Please investigate the failure and fix any issues."
echo "Created new issue"
else
# Add comment to existing issue
gh issue comment "$EXISTING_ISSUE" \
--body "The scheduled E2E test run has failed again.
**Failed Run:** $RUN_URL
**Time:** $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
echo "Added comment to issue #$EXISTING_ISSUE"
fi