Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Run e2e tests on pull_request #50

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 4 additions & 32 deletions .github/workflows/end2end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
name: End to end integration tests

on:
issue_comment:
types: [created]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches-ignore:
- main

env:
ANVIL_PRIVATE_KEY: ${{secrets.ANVIL_PRIVATE_KEY}}
Expand All @@ -14,32 +16,11 @@ jobs:
integration-tests-e2e:
name: E2E verification
runs-on: buildjet-16vcpu-ubuntu-2204
if:
github.event.issue.pull_request
&& github.event.issue.state == 'open'
&& contains(github.event.comment.body, '!test')
&& (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER')
steps:
- uses: xt0rted/pull-request-comment-branch@v2
id: comment-branch

- name: Exit if base branch is `main`
if: ${{ steps.comment-branch.outputs.base_ref == 'main' }}
run: |
echo "Cannot run end2end integration tests on PR targeting `main`"
exit 1
continue-on-error: false

- uses: actions/checkout@v4
with:
submodules: recursive

- name: Checkout PR branch
run: gh pr checkout $PR_NUMBER
env:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.issue.number }}

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
Expand All @@ -62,12 +43,3 @@ jobs:
- name: Check proof verification status
run: |
[[ $(cast call ${{steps.deployment.outputs.CONTRACT_ADDRESS}} "verify(uint32,uint256[],uint256[],bool)(bool)" "3" "[1]" "[0]" "true" --private-key $ANVIL_PRIVATE_KEY --rpc-url $ANVIL_URL) == true ]] && exit 0 || exit 1

- name: Comment on successful run
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.issue.number }}
body: |
End-to-end `!test` action succeeded! :rocket:

https://github.com/lurk-lab/solidity-verifier/actions/runs/${{ github.run_id }}
Loading