Skip to content

Frontend ERC20-Messaging #1528

Frontend ERC20-Messaging

Frontend ERC20-Messaging #1528

name: Frontend ERC20-Messaging
on:
pull_request:
branches:
- main
workflow_dispatch:
inputs:
e2e-test-type:
description: "Type of e2e-tests from dapp-frontend-erc20-messaging"
type: choice
default: light
options:
- light
- full
local-erc20-messaging-infra-ref:
description: "Git ref of local-erc20-messaging-infra"
required: false
dapp-frontend-erc20-messaging-ref:
description: "Git ref of dapp-frontend-erc20-messaging"
required: false
topos-docker-tag:
description: "Docker tag of topos"
required: false
topos-smart-contracts-docker-tag:
description: "Docker tag of topos-smart-contracts"
required: false
executor-service-docker-tag:
description: "Docker tag of executor-service"
required: false
env:
E2E_TEST_TYPE: ${{ inputs.e2e-test-type || 'light' }}
TOPOS_DOCKER_TAG: ${{ inputs.topos-docker-tag || 'latest' }}
CONTRACTS_DOCKER_TAG: ${{ inputs.topos-smart-contracts-docker-tag || 'latest' }}
EXECUTOR_SERVICE_DOCKER_TAG: ${{ inputs.executor-service-docker-tag || 'latest' }}
jobs:
infra-metadata:
uses: ./.github/workflows/util:get-latest-release.yml
with:
organization: topos-protocol
repository: local-erc20-messaging-infra
frontend-metadata:
uses: ./.github/workflows/util:get-latest-release.yml
with:
organization: topos-protocol
repository: dapp-frontend-erc20-messaging
e2e:
runs-on: ubuntu-latest-16-core
environment: devnet-1
env:
INFRA_REF: ${{ inputs.local-erc20-messaging-infra-ref || needs.infra-metadata.outputs.latest-release }}
FRONTEND_REF: ${{ inputs.dapp-frontend-erc20-messaging-ref || needs.frontend-metadata.outputs.latest-release }}
needs:
- infra-metadata
- frontend-metadata
steps:
- name: Display stack component versions
run: |
echo "event type: ${{ github.event_name }}"
echo "infra ref: ${{ env.INFRA_REF }}"
echo "frontend ref: ${{ env.FRONTEND_REF }}"
echo "topos docker tag: ${{ env.TOPOS_DOCKER_TAG }}"
echo "contracts docker tag: ${{ env.CONTRACTS_DOCKER_TAG }}"
echo "executor service docker tag: ${{ env.EXECUTOR_SERVICE_DOCKER_TAG }}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Checkout local-erc20-messaging-infra repo
uses: actions/checkout@v3
with:
repository: topos-protocol/local-erc20-messaging-infra
ref: ${{ env.INFRA_REF }}
path: infra
- name: Start local ERC20 messaging infra containers
run: >
cd infra &&
docker compose --profile executor-service up -d
env:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
TOKEN_DEPLOYER_SALT: ${{ secrets.TOKEN_DEPLOYER_SALT }}
TOPOS_CORE_SALT: ${{ secrets.TOPOS_CORE_SALT }}
TOPOS_CORE_PROXY_SALT: ${{ secrets.TOPOS_CORE_PROXY_SALT }}
ERC20_MESSAGING_SALT: ${{ secrets.ERC20_MESSAGING_SALT }}
SUBNET_REGISTRATOR_SALT: ${{ secrets.SUBNET_REGISTRATOR_SALT }}
TOPOS_VERSION: ${{ env.TOPOS_DOCKER_TAG }}
TOPOS_MESSAGING_PROTOCOL_CONTRACTS_VERSION: ${{ env.CONTRACTS_DOCKER_TAG }}
EXECUTOR_SERVICE_VERSION: ${{ env.EXECUTOR_SERVICE_DOCKER_TAG }}
- name: Debug containers
if: failure()
run: docker inspect contracts-topos | grep Image && docker logs contracts-topos
- name: Get contracts .env file and expose contract addresses for frontend
run: |
mkdir ./contracts
docker cp contracts-topos:/contracts/.env ./contracts/.env
source ./contracts/.env
echo "SUBNET_REGISTRATOR_CONTRACT_ADDRESS=${SUBNET_REGISTRATOR_CONTRACT_ADDRESS}" >> $GITHUB_ENV
echo "ERC20_MESSAGING_CONTRACT_ADDRESS=${ERC20_MESSAGING_CONTRACT_ADDRESS}" >> $GITHUB_ENV
echo "TOPOS_CORE_PROXY_CONTRACT_ADDRESS=${TOPOS_CORE_PROXY_CONTRACT_ADDRESS}" >> $GITHUB_ENV
- name: Checkout dapp-frontend-erc20-messaging repo
uses: actions/checkout@v3
with:
repository: topos-protocol/dapp-frontend-erc20-messaging
ref: ${{ env.FRONTEND_REF }}
path: frontend
- name: Run e2e tests
run: >
cd frontend &&
docker compose -f docker-compose.ci.yml up --build --exit-code-from synpress --attach synpress
env:
COMPOSE_DOCKER_CLI_BUILD: 1
DOCKER_BUILDKIT: 1
DOCKER_DEFAULT_PLATFORM: linux/amd64
CYPRESS_REMOTE_DEBUGGING_PORT: ${{ vars.CYPRESS_REMOTE_DEBUGGING_PORT }}
PORT: 3001
E2E_TEST_TYPE: ${{ env.E2E_TEST_TYPE }}
AUTH0_AUDIENCE: ${{ secrets.AUTH0_AUDIENCE }}
AUTH0_CLIENT_ID: ${{ secrets.AUTH0_CLIENT_ID }}
AUTH0_CLIENT_SECRET: ${{ secrets.AUTH0_CLIENT_SECRET }}
AUTH0_ISSUER_URL: ${{ secrets.AUTH0_ISSUER_URL }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
VITE_EXECUTOR_SERVICE_ENDPOINT: ${{ vars.EXECUTOR_SERVICE_ENDPOINT }}
VITE_SUBNET_REGISTRATOR_CONTRACT_ADDRESS: ${{ env.SUBNET_REGISTRATOR_CONTRACT_ADDRESS }}
VITE_ERC20_MESSAGING_CONTRACT_ADDRESS: ${{ env.ERC20_MESSAGING_CONTRACT_ADDRESS }}
VITE_TOPOS_CORE_PROXY_CONTRACT_ADDRESS: ${{ env.TOPOS_CORE_PROXY_CONTRACT_ADDRESS }}
VITE_TOPOS_SUBNET_ENDPOINT_WS: ${{ vars.TOPOS_SUBNET_ENDPOINT_WS }}
VITE_TOPOS_SUBNET_ENDPOINT_HTTP: ${{ vars.TOPOS_SUBNET_ENDPOINT_HTTP }}
VITE_ELASTIC_APM_ENDPOINT: ${{ secrets.ELASTIC_APM_ENDPOINT }}
VITE_TRACING_SERVICE_NAME: ${{ vars.TRACING_SERVICE_NAME }}
VITE_TRACING_SERVICE_VERSION: ${{ vars.TRACING_SERVICE_VERSION }}
- name: Debug docker show infra containers
if: failure()
run: docker ps
- name: Debug sending sequencer
if: failure()
run: docker logs topos-sequencer
- name: Debug receiving sequencer
if: failure()
run: docker logs incal-sequencer
- name: Debug topos node 1
if: failure()
run: docker logs topos-node-1
- name: Debug topos node 2
if: failure()
run: docker logs topos-node-2
- name: Debug topos node 3
if: failure()
run: docker logs topos-node-3
- name: Debug topos node 4
if: failure()
run: docker logs topos-node-4
- name: Debug incal node 1
if: failure()
run: docker logs incal-node-1
- name: Debug executor service
run: docker logs executor-service
- name: Archive e2e artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: e2e-artifacts
path: |
frontend/docker/videos
frontend/docker/videos-ci
frontend/docker/screenshots
continue-on-error: true