Skip to content

move helper libraries to core #72

move helper libraries to core

move helper libraries to core #72

Workflow file for this run

name: Test e2e
on:
push:
branches:
- '**'
schedule:
- cron: "0 2 * * *" # Run nightly at 2 AM UTC
workflow_dispatch: {}
jobs:
test-e2e:
strategy:
fail-fast: false
matrix:
include:
- network: "fork9-cdk-validium"
bats_tests: "light/batch-verification.bats,danger/access-list-e2e.bats"
deploy_infra: true
gas_token_addr: "0x72ae2643518179cF01bcA3278a37ceAD408DE8b2"
- network: "fork11-rollup"
bats_tests: "light/batch-verification.bats,light/eoa-transaction.bats,heavy/zk-counters-tests.bats"
deploy_infra: true
- network: "fork12-cdk-validium"
bats_tests: "light/batch-verification.bats,light/erc20-tests.bats,heavy/zk-counters-tests.bats"
deploy_infra: true
- network: "fork12-rollup"
bats_tests: "all"
deploy_infra: true
- network: "fork12-rollup"
bats_tests: "examples/tagged-test.bats"
deploy_infra: false
- network: "fork12-rollup"
bats_tests: "examples/tagged-test.bats"
filter_tags: "light"
deploy_infra: false
- network: "fork12-rollup"
bats_tests: "examples/tagged-test.bats"
filter_tags: "heavy"
deploy_infra: false
- network: "fork12-rollup"
bats_tests: "examples/tagged-test.bats"
filter_tags: "danger"
deploy_infra: false
- network: "fork12-rollup"
bats_tests: "examples/tagged-test.bats"
filter_tags: "tagged"
deploy_infra: false
- network: "fork12-rollup"
bats_tests: "examples/tagged-test.bats"
filter_tags: "heavy,danger"
deploy_infra: false
- network: "fork12-rollup"
bats_tests: "examples/tagged-test.bats"
filter_tags: "light,danger"
deploy_infra: false
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Kurtosis
if: matrix.deploy_infra
run: |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt update
sudo apt install kurtosis-cli=1.4.1
kurtosis version
- name: Disable kurtosis analytics
if: matrix.deploy_infra
run: kurtosis analytics disable
- name: Install yq
run: |
pip3 install yq
yq --version
- name: Install polycli
run: |
POLYCLI_VERSION=$(curl -s https://api.github.com/repos/0xPolygon/polygon-cli/releases/latest | jq -r '.tag_name')
tmp_dir=$(mktemp -d)
curl -L "https://github.com/0xPolygon/polygon-cli/releases/download/${POLYCLI_VERSION}/polycli_${POLYCLI_VERSION}_linux_amd64.tar.gz" | tar -xz -C "$tmp_dir"
mv "$tmp_dir"/* /usr/local/bin/polycli
rm -rf "$tmp_dir"
sudo chmod +x /usr/local/bin/polycli
/usr/local/bin/polycli version
- name: Install foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.11
env:
GOARCH: "amd64"
- name: Checkout Kurtosis CDK
if: matrix.deploy_infra
uses: actions/checkout@v4
with:
repository: 0xPolygon/kurtosis-cdk
path: "kurtosis-cdk"
ref: "v0.2.25"
- name: Setup Bats and bats libs
uses: bats-core/[email protected]
- name: Install runner
run: make install-runner
- name: Run E2E Tests
run: |
polygon-test-runner --network "${{ matrix.network }}" --bats-tests "${{ matrix.bats_tests }}" --filter-tags "${{ matrix.filter_tags }}" --deploy-infra "${{ matrix.deploy_infra }}" --kurtosis-folder "${{ github.workspace }}/kurtosis-cdk"
env:
GAS_TOKEN_ADDR: ${{ matrix.gas_token_addr }}
L2_RPC_URL: ${{ matrix.l2_rpc_url }}
- name: Dump enclave logs
if: failure() && matrix.deploy_infra
run: kurtosis dump ./dump
- name: Generate archive name
if: failure() && matrix.deploy_infra
run: |
archive_name="dump_run_with_args_${{ matrix.network }}_${{ github.run_id }}"
echo "ARCHIVE_NAME=${archive_name}" >> "$GITHUB_ENV"
kurtosis service exec cdk cdk-node-001 'cat /etc/cdk/cdk-node-config.toml' > ./dump/cdk-node-config.toml
- name: Upload logs
if: failure() && matrix.deploy_infra
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARCHIVE_NAME }}
path: ./dump