Skip to content

Commit 23eb122

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 53b5b52 commit 23eb122

1 file changed

Lines changed: 112 additions & 35 deletions

File tree

.github/workflows/e2e-test.yml

Lines changed: 112 additions & 35 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
@@ -35,6 +38,56 @@ jobs:
3538
with:
3639
github-token: ${{ secrets.GITHUB_TOKEN }}
3740

41+
build:
42+
name: Build vite-plus packages
43+
runs-on: ubuntu-latest
44+
permissions:
45+
contents: read
46+
packages: read
47+
needs:
48+
- download-previous-rolldown-binaries
49+
steps:
50+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
51+
- uses: ./.github/actions/clone
52+
53+
- name: Configure Git for access to vite-task
54+
run: git config --global url."https://x-access-token:${{ secrets.VITE_TASK_TOKEN }}@github.com/".insteadOf "https://github.com/"
55+
56+
- uses: oxc-project/setup-rust@d286d43bc1f606abbd98096666ff8be68c8d5f57 # v1.0.0
57+
with:
58+
save-cache: ${{ github.ref_name == 'main' }}
59+
cache-key: e2e-build
60+
61+
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
62+
63+
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
64+
with:
65+
name: rolldown-binaries
66+
path: ./rolldown/packages/rolldown/src
67+
merge-multiple: true
68+
69+
- name: Build with upstream
70+
uses: ./.github/actions/build-upstream
71+
with:
72+
target: x86_64-unknown-linux-gnu
73+
74+
- name: Pack packages into tgz
75+
run: |
76+
pnpm run bootstrap-cli:ci
77+
mkdir -p tmp/tgz
78+
cd packages/core && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
79+
cd packages/test && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
80+
cd packages/cli && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
81+
cd packages/global && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
82+
ls -la tmp/tgz
83+
84+
- name: Upload tgz artifacts
85+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
86+
with:
87+
name: vite-plus-packages
88+
path: tmp/tgz/*.tgz
89+
retention-days: 1
90+
3891
e2e-test:
3992
name: ${{ matrix.project.name }} E2E test
4093
env:
@@ -44,7 +97,7 @@ jobs:
4497
contents: read
4598
packages: read
4699
needs:
47-
- download-previous-rolldown-binaries
100+
- build
48101
runs-on: ubuntu-latest
49102
timeout-minutes: 10
50103
strategy:
@@ -67,7 +120,7 @@ jobs:
67120
# vite run format
68121
# vite run lint:check
69122
# vite run check
70-
# pnpm exec playwright install chromium
123+
# npx playwright install chromium
71124
# vite run test
72125
- name: rollipop
73126
node-version: 22
@@ -111,47 +164,22 @@ jobs:
111164
with:
112165
ecosystem-ci-project: ${{ matrix.project.name }}
113166

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

172+
- name: Download vite-plus packages
173+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
174+
with:
175+
name: vite-plus-packages
176+
path: tmp/tgz
177+
152178
- name: Install vite-plus from tgz in ${{ matrix.project.name }}
153179
working-directory: ecosystem-ci/${{ matrix.project.name }}
154180
run: |
181+
# install global CLI first
182+
npm install -g ../../tmp/tgz/voidzero-dev-global-0.0.0.tgz
155183
# avoid the vite migration using the wrong ignore file
156184
rm -f ../.gitignore
157185
node ../patch-project.ts ${{ matrix.project.name }}
@@ -160,3 +188,52 @@ jobs:
160188
- name: Run vite-plus commands in ${{ matrix.project.name }}
161189
working-directory: ecosystem-ci/${{ matrix.project.name }}
162190
run: ${{ matrix.project.command }}
191+
192+
notify-failure:
193+
name: Notify on failure
194+
runs-on: ubuntu-latest
195+
needs: e2e-test
196+
if: ${{ failure() && github.event_name == 'schedule' }}
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)