Skip to content

Schedule CI

Schedule CI #177

name: Schedule CI
on:
schedule:
- cron: '0 4,10 * * 1-5' # At 04:00 UTC (12:00 SGT) and 10:00 (18:00 SGT) UTC, Monday to Friday
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
# Requires manual check to ensure upstream changes in kurtosis-cdk workflow in ci_zkevm.yml
# is updated here
kurtosis-cdk:
runs-on: ubuntu-latest
# TODO: Add "cdk-validium" once it's ready
# strategy:
# matrix:
# da-mode: [ "rollup" ]
steps:
- name: Checkout cdk-erigon
uses: actions/checkout@v4
with:
path: cdk-erigon
- name: Checkout kurtosis-cdk
uses: actions/checkout@v4
with:
repository: 0xPolygon/kurtosis-cdk
ref: main
path: kurtosis-cdk
- name: Install Kurtosis CDK tools
uses: ./kurtosis-cdk/.github/actions/setup-kurtosis-cdk
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Install yq
run: |
sudo curl -L https://github.com/mikefarah/yq/releases/download/v4.44.2/yq_linux_amd64 -o /usr/local/bin/yq
sudo chmod +x /usr/local/bin/yq
/usr/local/bin/yq --version
- name: Build docker image
working-directory: ./cdk-erigon
run: docker build -t cdk-erigon:local --file Dockerfile .
- name: Configure Kurtosis CDK
working-directory: ./kurtosis-cdk
run: |
/usr/local/bin/yq -i '.args.data_availability_mode = "rollup"' cdk-erigon-sequencer-params.yml
/usr/local/bin/yq -i '.args.cdk_erigon_node_image = "cdk-erigon:local"' cdk-erigon-sequencer-params.yml
/usr/local/bin/yq -i '.args.zkevm_bridge_service_image = "hermeznetwork/zkevm-bridge-service:v0.5.0-RC8"' cdk-erigon-sequencer-params.yml
sed -i '/zkevm\.sequencer-initial-fork-id/d' ./templates/cdk-erigon/config-sequencer.yaml
- name: Deploy Kurtosis CDK package
working-directory: ./kurtosis-cdk
run: kurtosis run --enclave cdk-v1 --args-file cdk-erigon-sequencer-params.yml --image-download always .
- name: Monitor verified batches
working-directory: ./kurtosis-cdk
shell: bash
run: .github/actions/monitor-cdk-verified-batches/batch_verification_monitor.sh 20 900 cdk-erigon-node-001
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set up envs
run: |
kurtosis files download cdk-v1 bridge-config-artifact
echo "BRIDGE_ADDRESS=$(/usr/local/bin/yq '.NetworkConfig.PolygonBridgeAddress' bridge-config-artifact/bridge-config.toml)" >> $GITHUB_ENV
echo "ETH_RPC_URL=$(kurtosis port print cdk-v1 el-1-geth-lighthouse rpc)" >> $GITHUB_ENV
echo "L2_RPC_URL=$(kurtosis port print cdk-v1 cdk-erigon-node-001 http-rpc)" >> $GITHUB_ENV
echo "BRIDGE_API_URL=$(kurtosis port print cdk-v1 zkevm-bridge-service-001 rpc)" >> $GITHUB_ENV
- name: Fund claim tx manager
run: |
cast send --legacy --private-key "0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625" --value 5ether 0x5f5dB0D4D58310F53713eF4Df80ba6717868A9f8 --gas-limit 50000 --rpc-url $L2_RPC_URL
- name: Clone bridge repository
run: git clone --recurse-submodules -j8 https://github.com/0xPolygonHermez/zkevm-bridge-service.git -b develop bridge
- name: Build docker image
run: |
cd bridge
make build-docker-e2e-real_network
- name: Run test ERC20 Bridge
run: |
#!/bin/bash
cd bridge
mkdir tmp
cat <<EOF > ./tmp/test.toml
TestL1AddrPrivate="0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625"
TestL2AddrPrivate="0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625"
[ConnectionConfig]
L1NodeURL="${ETH_RPC_URL}"
L2NodeURL="${L2_RPC_URL}"
BridgeURL="${BRIDGE_API_URL}"
L1BridgeAddr="${BRIDGE_ADDRESS}"
L2BridgeAddr="${BRIDGE_ADDRESS}"
EOF
docker run --network=host --volume "./tmp/:/config/" --env BRIDGE_TEST_CONFIG_FILE=/config/test.toml bridge-e2e-realnetwork-erc20
- name: Upload logs
uses: actions/upload-artifact@v3
with:
name: evm-rpc-tests-logs-${{ github.run_id }}
path: ./cdk-erigon/logs/evm-rpc-tests.log
- name: Prepare logs
working-directory: ./kurtosis-cdk
if: failure()
run: |
mkdir -p ci_logs
cd ci_logs
kurtosis service logs cdk-v1 cdk-erigon-node-001 --all > cdk-erigon-node-001.log
kurtosis service logs cdk-v1 cdk-erigon-sequencer-001 --all > cdk-erigon-sequencer-001.log
kurtosis service logs cdk-v1 zkevm-agglayer-001 --all > zkevm-agglayer-001.log
kurtosis service logs cdk-v1 zkevm-prover-001 --all > zkevm-prover-001.log
kurtosis service logs cdk-v1 zkevm-executor-pless-001 --all > zkevm-executor-pless-001.log
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: logs_${{ github.run_id }}
path: ./kurtosis-cdk/ci_logs