Skip to content

E2E tests

E2E tests #206

Workflow file for this run

name: E2E tests
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
inputs:
network:
description: 'Select the blockchain network for testing'
required: false
default: 'emerynet'
type: choice
options:
- local
- emerynet
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label ||
github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
e2e:
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
env:
IS_EMERYNET_TEST: ${{ github.event_name == 'schedule' || inputs.network == 'emerynet' }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Run e2e tests
run: |
docker compose -f tests/e2e/docker-compose.yml --profile $SYNPRESS_PROFILE up --build --exit-code-from synpress
env:
# conditionals based on github event
SYNPRESS_PROFILE: ${{ env.IS_EMERYNET_TEST == 'true' && 'daily-tests' || 'synpress' }}
CYPRESS_AGORIC_NET: ${{ env.IS_EMERYNET_TEST == 'true' && 'emerynet' || 'local' }}
# for docker-compose.yml
COMPOSE_DOCKER_CLI_BUILD: 1
DOCKER_BUILDKIT: 1
DOCKER_DEFAULT_PLATFORM: linux/amd64
NGROK_AUTH: ${{ secrets.NGROK_AUTH }}
NGROK_BASIC_AUTH: ${{ secrets.NGROK_BASIC_AUTH }}
CYPRESS_PRIVATE_KEY_WITH_FUNDS: ${{ secrets.CYPRESS_PRIVATE_KEY_WITH_FUNDS }}
ANVIL_FORK_URL: ${{ secrets.ANVIL_FORK_URL }}
GH_PAT: ${{ secrets.GH_PAT }}
GH_USERNAME: ${{ secrets.GH_USERNAME }}
GOV1_PHRASE: ${{ secrets.GOV1_PHRASE }}
GOV2_PHRASE: ${{ secrets.GOV2_PHRASE }}
# cypress dashboard
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
COMMIT_INFO_SHA: ${{ github.event.pull_request.head.sha }}
- name: Archive e2e artifacts locally
uses: actions/upload-artifact@v3
if: ${{ env.IS_EMERYNET_TEST == 'false' && !cancelled()}}
with:
name: e2e-artifacts
path: |
tests/e2e/docker/videos
tests/e2e/docker/screenshots
continue-on-error: true
- name: Archive e2e artifacts to GCS
uses: google-github-actions/upload-cloud-storage@v2
if: ${{ env.IS_EMERYNET_TEST == 'true' && !cancelled() }}
with:
path: 'tests/e2e/docker'
destination: 'github-artifacts/${{ github.repository }}/${{ github.run_id }}/${{ github.event.repository.updated_at }}'
continue-on-error: true
- name: Log Path to GCS Artifacts
if: ${{ env.IS_EMERYNET_TEST == 'true' && !cancelled() }}
run: echo "https://console.cloud.google.com/storage/browser/github-artifacts/${{ github.repository }}/${{ github.run_id }}/${{ github.event.repository.updated_at }}/docker/videos"
- name: Notify About Failure
if: >
failure() && github.event_name != 'pull_request' &&
github.repository_owner == 'agoric'
uses: ./.github/actions/notify-status
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
continue-on-error: true