Files
linea-monorepo/.github/workflows/reuse-run-e2e-tests.yml
Pedro Novais 829630b0a1 Coordinator: replace teku ExecutionPlayloadV1 by Domain Block class - fix block encoding (#406)
* coordinator: replace Teku ExecutionPayloadV1.kt by our own Domain Block
* update GHA runners and CI fixes
---------
Signed-off-by: Pedro Novais <1478752+jpnovais@users.noreply.github.com>
Co-authored-by: Roman Vaseev <4833306+Filter94@users.noreply.github.com>
2024-12-16 17:04:38 +00:00

194 lines
7.5 KiB
YAML

name: Reusable run e2e tests
on:
workflow_dispatch:
inputs:
commit_tag:
description: 'The commit tag to use'
required: true
type: string
tracing-engine:
description: Variable option for running tests against [besu] or [geth] stack
required: true
type: string
e2e-tests-with-ssh:
description: Run end to end tests with ability to ssh into environment
required: false
type: boolean
default: false
e2e-tests-logs-dump:
description: Dump logs after running end to end tests
required: false
type: boolean
default: false
e2e-tests-containers-list:
description: List containers before starting end to end tests
required: false
type: boolean
default: true
workflow_call:
inputs:
commit_tag:
required: true
type: string
tracing-engine:
description: Variable option for running tests against [besu] or [geth] stack
required: true
type: string
e2e-tests-with-ssh:
description: Run end to end tests with ability to ssh into environment
required: false
type: boolean
default: false
e2e-tests-logs-dump:
description: Dump logs after running end to end tests
required: false
type: boolean
default: false
e2e-tests-containers-list:
description: List containers before starting end to end tests
required: false
type: boolean
default: true
has-changes-requiring-build:
type: string
outputs:
tests_outcome:
value: ${{ jobs.run-e2e-tests.outputs.tests_outcome }}
secrets:
DOCKERHUB_USERNAME:
required: false
DOCKERHUB_TOKEN:
required: false
jobs:
# Required job
run-e2e-tests:
# We can only use conditionals, and not path filters to 'successfully' skip a required job - https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks
if: ${{ inputs.has-changes-requiring-build == 'true' }}
env:
COORDINATOR_TAG: ${{ inputs.commit_tag }}
POSTMAN_TAG: ${{ inputs.commit_tag }}
PROVER_TAG: ${{ inputs.commit_tag }}
TRACES_API_TAG: ${{ inputs.commit_tag }}
TRANSACTION_EXCLUSION_API_TAG: ${{ inputs.commit_tag }}
GITHUB_TOKEN: ${{ secrets._GITHUB_TOKEN_RELEASE_ACCESS }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
outputs:
tests_outcome: ${{ steps.run_e2e_tests.outcome }}
runs-on: gha-runner-scale-set-ubuntu-22.04-amd64-large
steps:
- name: Setup upterm session
if: ${{ inputs.e2e-tests-with-ssh }}
uses: lhotari/action-upterm@v1
- name: Checkout
uses: actions/checkout@v4
- name: Setup nodejs environment
uses: ./.github/actions/setup-nodejs
with:
pnpm-install-options: '-F contracts -F e2e --frozen-lockfile --prefer-offline'
- name: Login to Docker Hub
if: ${{ env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != '' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create directory for conflated traces
run: |
mkdir -p tmp/local/traces/v2/conflated
chmod -R a+w tmp/local/traces/v2/conflated
- name: Restore cached images
id: restore-cached-images
uses: actions/cache/restore@v4.0.2
with:
path: ~/docker-images
key: cached-images
restore-keys: |
cached-
- name: Pull all images with retry
uses: nick-fields/retry@v3
with:
max_attempts: 10
retry_on: error
retry_wait_seconds: 30
timeout_minutes: 10
command: |
make pull-images-external-to-monorepo
- name: Download local docker image artifacts
uses: actions/download-artifact@v4
with:
pattern: linea-*
- name: Load Docker images
run: |
pwd && ls -la && echo "GITHUB_WORKSPACE=$GITHUB_WORKSPACE" &&
gunzip -c $GITHUB_WORKSPACE/linea-coordinator/linea-coordinator-docker-image.tar.gz | docker load &&
gunzip -c $GITHUB_WORKSPACE/linea-postman/linea-postman-docker-image.tar.gz | docker load &&
gunzip -c $GITHUB_WORKSPACE/linea-prover/linea-prover-docker-image.tar.gz | docker load &&
gunzip -c $GITHUB_WORKSPACE/linea-traces-api-facade/linea-traces-api-facade-docker-image.tar.gz | docker load &&
gunzip -c $GITHUB_WORKSPACE/linea-transaction-exclusion-api/linea-transaction-exclusion-api-docker-image.tar.gz | docker load
shell: bash
- name: Spin up fresh environment with geth tracing with retry
if: ${{ inputs.tracing-engine == 'geth' }}
uses: nick-fields/retry@v3
with:
max_attempts: 10
retry_on: error
retry_wait_seconds: 30
timeout_minutes: 10
command: |
make start-all
on_retry_command: |
make clean-environment
- name: Spin up fresh environment with besu tracing with retry
if: ${{ inputs.tracing-engine == 'besu' }}
uses: nick-fields/retry@v3
with:
max_attempts: 10
retry_on: error
retry_wait_seconds: 30
timeout_minutes: 10
command: |
make start-all-traces-v2
on_retry_command: |
make clean-environment
- name: List docker containers/images
if: ${{ always() && inputs.e2e-tests-containers-list }}
continue-on-error: true
run: |
docker ps -la && docker images
docker container ls -a
- name: Run e2e tests
id: run_e2e_tests
timeout-minutes: 4
run: |
pnpm run -F e2e test:e2e:local
- name: Show e2e tests result
if: always()
run: |
echo "E2E_TESTS_RESULT: ${{ steps.run_e2e_tests.outcome }}"
- name: Dump logs
if: ${{ failure() && inputs.e2e-tests-logs-dump }}
run: |
mkdir -p docker_logs
docker ps -a >> docker_logs/docker_ps.txt
docker logs coordinator --since 1h &>> docker_logs/coordinator.txt
docker logs prover --since 1h &>> docker_logs/prover.txt
docker logs prover-v3 --since 1h &>> docker_logs/prover-v3.txt;
docker logs shomei --since 1h &>> docker_logs/shomei.txt
docker logs zkbesu-shomei --since 1h &>> docker_logs/zkbesu-shomei.txt
docker logs shomei-frontend --since 1h &>> docker_logs/shomei-frontend.txt
docker logs postman --since 1h &>> docker_logs/postman.txt
docker logs traces-node --since 1h &>> docker_logs/traces-node.txt
docker logs traces-node-v2 --since 1h &>> docker_logs/traces-node-v2.txt;
docker logs l2-node-besu --since 1h &>> docker_logs/l2-node-besu.txt;
docker logs transaction-exclusion-api --since 1h &>> docker_logs/transaction-exclusion-api.txt
docker logs sequencer --since 1h &>> docker_logs/sequencer.txt
- name: Archive debug logs
uses: actions/upload-artifact@v4
if: ${{ failure() && inputs.e2e-tests-logs-dump }}
with:
name: end-2-end-debug-logs
if-no-files-found: error
path: |
docker_logs/**/*