Skip to content

Commit 16d346b

Browse files
committed
add e2e test workflow
1 parent 6cf5c96 commit 16d346b

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed

.github/workflows/run_e2e_test.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Run E2E Test on Comment
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
jobs:
8+
check-comment:
9+
runs-on: [self-hosted, linux, x64, gpu]
10+
11+
outputs:
12+
run_tests: ${{ steps.check.outputs.run_tests }}
13+
14+
steps:
15+
# Step 1: Check if the comment mentions the bot and contains "run e2e gpu test"
16+
- name: Check if the comment mentions the bot and contains "run e2e gpu test"
17+
id: check
18+
run: |
19+
COMMENT=$(jq -r .comment.body "$GITHUB_EVENT_PATH")
20+
BOT_USERNAME="@e2e-gpu-tester" # Replace with your bot's username
21+
if [[ $COMMENT == *"$BOT_USERNAME"* ]] && [[ $COMMENT == *"run e2e gpu test"* ]]; then
22+
echo "::set-output name=run_tests::true"
23+
else
24+
echo "::set-output name=run_tests::false"
25+
fi
26+
27+
# Optional: Output debug information
28+
- name: Debug Check
29+
run: echo "Run Tests: ${{ steps.check.outputs.run_tests }}"
30+
31+
run-tests:
32+
needs: check-comment
33+
if: needs.check-comment.outputs.run_tests == 'true'
34+
runs-on: ubuntu-latest
35+
36+
steps:
37+
- name: Checkout repository
38+
uses: actions/checkout@v3
39+
40+
- name: Checkout plonky3-gpu repositories
41+
uses: actions/checkout@v3
42+
with:
43+
repository: scroll-tech/plonky3-gpu
44+
path: plonky3-gpu
45+
ref: openvm-v2
46+
47+
- name: Checkout openvm-stark-gpu repositories
48+
uses: actions/checkout@v3
49+
with:
50+
repository: scroll-tech/openvm-stark-gpu
51+
path: openvm-stark-gpu
52+
ref: main
53+
54+
- name: Checkout openvm-gpu repositories
55+
uses: actions/checkout@v3
56+
with:
57+
repository: scroll-tech/openvm-gpu
58+
path: openvm-gpu
59+
ref: rebase/0306
60+
61+
- name: Run E2E GPU Test
62+
run: |
63+
echo "Running e2e gpu tests..."
64+
# Add your test execution commands here, e.g.:
65+
SCROLL_ZKVM_VERSION=0.1.0-rc.6 make download-release
66+
make test-e2e-bundle
67+
68+
- name: Notify Results
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
run: |
72+
BODY="✅ E2E GPU test has been successfully completed."
73+
# Using curl to post a new comment since GitHub API does not support replying directly to a specific comment
74+
COMMENT_ID=$(jq -r .comment.id "$GITHUB_EVENT_PATH")
75+
ISSUE_NUMBER=$(jq -r .issue.number "$GITHUB_EVENT_PATH")
76+
REPO_FULL_NAME=$(jq -r .repository.full_name "$GITHUB_EVENT_PATH")
77+
78+
# Note: Directly replying to a comment is not supported. Instead, create a new comment on the issue.
79+
curl -X POST -H "Authorization: Bearer $GITHUB_TOKEN" \
80+
-H "Content-Type: application/json" \
81+
"https://api.github.com/repos/$REPO_FULL_NAME/issues/$ISSUE_NUMBER/comments" \
82+
-d '{
83+
"body": "'"$BODY"'"
84+
}'

0 commit comments

Comments
 (0)