Skip to content

test: Allow CCTP tests to be ran with comment #31

test: Allow CCTP tests to be ran with comment

test: Allow CCTP tests to be ran with comment #31

name: PR approved workflow
on:
issue_comment:
types:
- created
pull_request_review:
types:
- submitted
push:
branches: ["master"]
merge_group:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-cctp
cancel-in-progress: true
env:
NEXT_PUBLIC_INFURA_KEY: ${{ secrets.NEXT_PUBLIC_INFURA_KEY }}
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID }}
THE_GRAPH_NETWORK_API_KEY: ${{ secrets.THE_GRAPH_NETWORK_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
check-files:
name: Check files
runs-on: ubuntu-latest
outputs:
run_tests: ${{ steps.check-files.outputs.run_tests }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/check-files
id: check-files
build:
name: "Build"
runs-on: ubuntu-latest
needs: [check-files]
if: |
(needs.check-files.outputs.run_tests == 'true' && ${{ !contains(github.event.pull_request.title, 'hotfix') }}) ||
(contains(github.event.comment.html_url, '/pull/') && github.event.comment.body == '/run-cctp-tests')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install node_modules
uses: OffchainLabs/actions/node-modules/install@main
- name: Build
run: yarn build
env:
NEXT_PUBLIC_IS_E2E_TEST: true
NEXT_PUBLIC_INFURA_KEY: ${{ secrets.NEXT_PUBLIC_INFURA_KEY }}
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID }}
THE_GRAPH_NETWORK_API_KEY: ${{ secrets.THE_GRAPH_NETWORK_API_KEY }}
- name: Cache build artifacts
uses: ./.github/actions/build-artifacts/cache
cctp-e2e-tests:
name: "CCTP E2E Tests"
needs: [build, check-files]
# Only run CCTP tests when the PR was just approved
uses: ./.github/workflows/e2e-tests.yml
with:
test_type: 'cctp'
secrets: inherit
test-e2e-success:
name: "Test E2E Success"
runs-on: ubuntu-latest
needs: [cctp-e2e-tests]
if: always()
steps:
- name: Regular E2E Succeeded
if: needs.cctp-e2e-tests.result == 'success' || needs.cctp-e2e-tests.result == 'skipped'
run: echo "Regular E2E tests passed"
- name: Regular E2E Failed
if: needs.cctp-e2e-tests.result != 'success' && needs.cctp-e2e-tests.result != 'skipped'
run: exit 1