Skip to content

Commit 379ebc0

Browse files
fengmk2claude
andcommitted
ci(e2e): add daily scheduled run with failure notification
- Run E2E tests daily at 0:00 GMT (8:00 AM Shanghai time) - Create GitHub issue on failure with 'e2e-failure' label - Reuse existing issue by adding comments on subsequent failures - Only notify on scheduled run failures, not on success 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 9f1d497 commit 379ebc0

1 file changed

Lines changed: 117 additions & 36 deletions

File tree

.github/workflows/e2e-test.yml

Lines changed: 117 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ permissions: {}
44

55
on:
66
workflow_dispatch:
7+
schedule:
8+
# Run every day at 0:00 GMT (8:00 AM Singapore time)
9+
- cron: '0 0 * * *'
710
push:
811
branches:
912
- main
@@ -34,6 +37,56 @@ jobs:
3437
with:
3538
github-token: ${{ secrets.GITHUB_TOKEN }}
3639

40+
build:
41+
name: Build vite-plus packages
42+
runs-on: ubuntu-latest
43+
permissions:
44+
contents: read
45+
packages: read
46+
needs:
47+
- download-previous-rolldown-binaries
48+
steps:
49+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
50+
- uses: ./.github/actions/clone
51+
52+
- name: Configure Git for access to vite-task
53+
run: git config --global url."https://x-access-token:${{ secrets.VITE_TASK_TOKEN }}@github.com/".insteadOf "https://github.com/"
54+
55+
- uses: oxc-project/setup-rust@d286d43bc1f606abbd98096666ff8be68c8d5f57 # v1.0.0
56+
with:
57+
save-cache: ${{ github.ref_name == 'main' }}
58+
cache-key: e2e-build
59+
60+
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
61+
62+
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
63+
with:
64+
name: rolldown-binaries
65+
path: ./rolldown/packages/rolldown/src
66+
merge-multiple: true
67+
68+
- name: Build with upstream
69+
uses: ./.github/actions/build-upstream
70+
with:
71+
target: x86_64-unknown-linux-gnu
72+
73+
- name: Pack packages into tgz
74+
run: |
75+
pnpm run bootstrap-cli:ci
76+
mkdir -p tmp/tgz
77+
cd packages/core && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
78+
cd packages/test && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
79+
cd packages/cli && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
80+
cd packages/global && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
81+
ls -la tmp/tgz
82+
83+
- name: Upload tgz artifacts
84+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
85+
with:
86+
name: vite-plus-packages
87+
path: tmp/tgz/*.tgz
88+
retention-days: 1
89+
3790
e2e-test:
3891
name: ${{ matrix.project.name }} E2E test
3992
env:
@@ -43,16 +96,17 @@ jobs:
4396
contents: read
4497
packages: read
4598
needs:
46-
- download-previous-rolldown-binaries
99+
- build
47100
runs-on: ubuntu-latest
101+
timeout-minutes: 10
48102
strategy:
49103
fail-fast: false
50104
matrix:
51105
project:
52106
- name: vibe-dashboard
53107
node-version: 24
54108
command: |
55-
pnpm playwright install --with-deps
109+
npx playwright install chromium
56110
# FIXME: Failed to load JS plugin: ./plugins/debugger.js
57111
# vite run ready
58112
vite fmt
@@ -65,11 +119,13 @@ jobs:
65119
# vite run format
66120
# vite run lint:check
67121
# vite run check
68-
# pnpm exec playwright install chromium
122+
# npx playwright install chromium
69123
# vite run test
70124
- name: rollipop
71125
node-version: 22
72126
command: |
127+
# mock error
128+
vite run -r test
73129
vite run -r build
74130
vite run lint
75131
vite run -r typecheck
@@ -107,47 +163,22 @@ jobs:
107163
with:
108164
ecosystem-ci-project: ${{ matrix.project.name }}
109165

110-
- name: Configure Git for access to vite-task
111-
run: git config --global url."https://x-access-token:${{ secrets.VITE_TASK_TOKEN }}@github.com/".insteadOf "https://github.com/"
112-
113-
- uses: oxc-project/setup-rust@d286d43bc1f606abbd98096666ff8be68c8d5f57 # v1.0.0
114-
with:
115-
save-cache: ${{ github.ref_name == 'main' }}
116-
cache-key: e2e-test
117-
118-
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
119-
120-
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
121-
with:
122-
name: rolldown-binaries
123-
path: ./rolldown/packages/rolldown/src
124-
merge-multiple: true
125-
126-
- name: Build with upstream
127-
uses: ./.github/actions/build-upstream
128-
with:
129-
target: x86_64-unknown-linux-gnu
130-
131-
- name: Build all packages
132-
run: pnpm bootstrap-cli:ci
133-
134-
- name: Pack packages into tgz
135-
run: |
136-
mkdir -p tmp/tgz
137-
cd packages/core && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
138-
cd packages/test && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
139-
cd packages/cli && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
140-
cd packages/global && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
141-
ls -la tmp/tgz
142-
143166
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
144167
with:
145168
node-version: ${{ matrix.project.node-version }}
146169
package-manager-cache: false
147170

171+
- name: Download vite-plus packages
172+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
173+
with:
174+
name: vite-plus-packages
175+
path: tmp/tgz
176+
148177
- name: Install vite-plus from tgz in ${{ matrix.project.name }}
149178
working-directory: ecosystem-ci/${{ matrix.project.name }}
150179
run: |
180+
# install global CLI first
181+
npm install -g ../../tmp/tgz/voidzero-dev-global-0.0.0.tgz
151182
# avoid the vite migration using the wrong ignore file
152183
rm -f ../.gitignore
153184
node ../patch-project.ts ${{ matrix.project.name }}
@@ -156,3 +187,53 @@ jobs:
156187
- name: Run vite-plus commands in ${{ matrix.project.name }}
157188
working-directory: ecosystem-ci/${{ matrix.project.name }}
158189
run: ${{ matrix.project.command }}
190+
191+
notify-failure:
192+
name: Notify on failure
193+
runs-on: ubuntu-latest
194+
needs: e2e-test
195+
# if: ${{ failure() && github.event_name == 'schedule' }}
196+
if: ${{ failure() && github.event_name == 'pull_request' }}
197+
permissions:
198+
contents: read
199+
issues: write
200+
steps:
201+
- name: Create or update GitHub issue on failure
202+
env:
203+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
204+
GH_REPO: ${{ github.repository }}
205+
run: |
206+
ISSUE_TITLE="E2E Test Scheduled Run Failed"
207+
ISSUE_LABEL="e2e-failure"
208+
RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
209+
210+
# Create label if it doesn't exist
211+
if ! gh label list --json name --jq '.[].name' | grep -q "^${ISSUE_LABEL}$"; then
212+
gh label create "$ISSUE_LABEL" --color "d73a4a" --description "E2E test scheduled run failure"
213+
echo "Created label: $ISSUE_LABEL"
214+
fi
215+
216+
# Search for existing open issue with the label
217+
EXISTING_ISSUE=$(gh issue list --label "$ISSUE_LABEL" --state open --json number --jq '.[0].number')
218+
219+
if [ -z "$EXISTING_ISSUE" ]; then
220+
# Create new issue if none exists
221+
gh issue create \
222+
--title "$ISSUE_TITLE" \
223+
--label "$ISSUE_LABEL" \
224+
--body "The scheduled E2E test run has failed.
225+
226+
**Failed Run:** $RUN_URL
227+
**Time:** $(date -u '+%Y-%m-%d %H:%M:%S UTC')
228+
229+
Please investigate the failure and fix any issues."
230+
echo "Created new issue"
231+
else
232+
# Add comment to existing issue
233+
gh issue comment "$EXISTING_ISSUE" \
234+
--body "The scheduled E2E test run has failed again.
235+
236+
**Failed Run:** $RUN_URL
237+
**Time:** $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
238+
echo "Added comment to issue #$EXISTING_ISSUE"
239+
fi

0 commit comments

Comments
 (0)