rebase with main #165
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
# Fork 9 - Validium | |
- network: "fork9-cdk-erigon-validium" | |
filter_tags: "light" | |
# Fork 11 - Validium | |
- network: "fork11-cdk-erigon-validium" | |
filter_tags: "zk-counters" | |
# Fork 12 - Validium | |
- network: "fork12-cdk-erigon-validium" | |
filter_tags: "batch-verification,gas-limit-overflow,access-list" | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Run ShellCheck (Linting) | |
run: | | |
sudo apt-get update && sudo apt-get install -y shellcheck | |
shellcheck core/helpers/common-setup.bash test-runner.sh $(find tests -type f -name "*.bats") | |
- name: Install Kurtosis | |
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 | |
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 | |
uses: actions/checkout@v4 | |
with: | |
repository: 0xPolygon/kurtosis-cdk | |
path: "kurtosis-cdk" | |
ref: "v0.2.30" | |
- name: Setup Bats and bats libs | |
uses: bats-core/[email protected] | |
- name: Setup Devnet w/ Kurtosis | |
run: | | |
./core/helpers/setup-kurtosis.sh "${{ matrix.network }}" | |
- name: Export L2_RPC_URL and L2_SEQUENCER_RPC_URL for CI | |
run: | | |
echo "✅ Using Kurtosis RPC URL: $L2_RPC_URL" | |
echo "✅ Using Kurtosis SEQUENCER RPC URL: $L2_SEQUENCER_RPC_URL" | |
# Ensure the .env file exists | |
touch tests/.env | |
# Remove any existing L2_RPC_URL entry (if it exists) | |
sed -i '/^L2_RPC_URL=/d' tests/.env | |
sed -i '/^L2_SEQUENCER_RPC_URL=/d' tests/.env | |
# Append the new L2_RPC_URL and L2_SEQUENCER_RPC_URL to .env with a newline | |
echo "" >> tests/.env | |
echo "L2_RPC_URL=$L2_RPC_URL" >> tests/.env | |
echo "L2_SEQUENCER_RPC_URL=$L2_SEQUENCER_RPC_URL" >> tests/.env | |
# Print the updated .env for debugging | |
cat tests/.env | |
- name: Build polygon-test-runner | |
run: | | |
make install | |
- name: Run E2E Tests | |
run: | | |
polygon-test-runner --filter-tags "${{ matrix.filter_tags }}" | |
- name: Dump enclave logs | |
if: failure() | |
run: kurtosis dump ./dump | |
- name: Generate archive name | |
if: failure() | |
run: | | |
archive_name="dump_run_with_args_${{ matrix.network }}_${{ github.run_id }}_${{ strategy.job-index }}" | |
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() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.ARCHIVE_NAME }} | |
path: ./dump |