Skip to content

Commit 8a7265a

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 <[email protected]>
1 parent 9f1d497 commit 8a7265a

1 file changed

Lines changed: 104 additions & 34 deletions

File tree

.github/workflows/e2e-test.yml

Lines changed: 104 additions & 34 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,55 @@ 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+
mkdir -p tmp/tgz
76+
cd packages/core && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
77+
cd packages/test && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
78+
cd packages/cli && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
79+
cd packages/global && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
80+
ls -la tmp/tgz
81+
82+
- name: Upload tgz artifacts
83+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
84+
with:
85+
name: vite-plus-packages
86+
path: tmp/tgz/*.tgz
87+
retention-days: 1
88+
3789
e2e-test:
3890
name: ${{ matrix.project.name }} E2E test
3991
env:
@@ -43,7 +95,7 @@ jobs:
4395
contents: read
4496
packages: read
4597
needs:
46-
- download-previous-rolldown-binaries
98+
- build
4799
runs-on: ubuntu-latest
48100
strategy:
49101
fail-fast: false
@@ -107,47 +159,22 @@ jobs:
107159
with:
108160
ecosystem-ci-project: ${{ matrix.project.name }}
109161

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-
143162
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
144163
with:
145164
node-version: ${{ matrix.project.node-version }}
146165
package-manager-cache: false
147166

167+
- name: Download vite-plus packages
168+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
169+
with:
170+
name: vite-plus-packages
171+
path: tmp/tgz
172+
148173
- name: Install vite-plus from tgz in ${{ matrix.project.name }}
149174
working-directory: ecosystem-ci/${{ matrix.project.name }}
150175
run: |
176+
# install global CLI first
177+
npm install -g ../../tmp/tgz/voidzero-dev-global-0.0.0.tgz
151178
# avoid the vite migration using the wrong ignore file
152179
rm -f ../.gitignore
153180
node ../patch-project.ts ${{ matrix.project.name }}
@@ -156,3 +183,46 @@ jobs:
156183
- name: Run vite-plus commands in ${{ matrix.project.name }}
157184
working-directory: ecosystem-ci/${{ matrix.project.name }}
158185
run: ${{ matrix.project.command }}
186+
187+
notify-failure:
188+
name: Notify on failure
189+
runs-on: ubuntu-latest
190+
needs: e2e-test
191+
# if: ${{ failure() && github.event_name == 'schedule' }}
192+
permissions:
193+
contents: read
194+
issues: write
195+
steps:
196+
- name: Create or update GitHub issue on failure
197+
env:
198+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
199+
GH_REPO: ${{ github.repository }}
200+
run: |
201+
ISSUE_TITLE="E2E Test Scheduled Run Failed"
202+
ISSUE_LABEL="e2e-failure"
203+
RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
204+
205+
# Search for existing open issue with the label
206+
EXISTING_ISSUE=$(gh issue list --label "$ISSUE_LABEL" --state open --json number --jq '.[0].number')
207+
208+
if [ -z "$EXISTING_ISSUE" ]; then
209+
# Create new issue if none exists
210+
gh issue create \
211+
--title "$ISSUE_TITLE" \
212+
--label "$ISSUE_LABEL" \
213+
--body "The scheduled E2E test run has failed.
214+
215+
**Failed Run:** $RUN_URL
216+
**Time:** $(date -u '+%Y-%m-%d %H:%M:%S UTC')
217+
218+
Please investigate the failure and fix any issues."
219+
echo "Created new issue"
220+
else
221+
# Add comment to existing issue
222+
gh issue comment "$EXISTING_ISSUE" \
223+
--body "The scheduled E2E test run has failed again.
224+
225+
**Failed Run:** $RUN_URL
226+
**Time:** $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
227+
echo "Added comment to issue #$EXISTING_ISSUE"
228+
fi

0 commit comments

Comments
 (0)