Skip to content

chore: add testing configuration #112

chore: add testing configuration

chore: add testing configuration #112

name: ZKSync Integration Test
on:
push:
branches:
- main
- develop
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
Test:
runs-on: ubuntu-latest
environment: Test
steps:
- uses: actions/checkout@v4
# Run Dockerized L1-L2, goes first because it takes a lot of time
- name: Setup Dockerized L1-L2
run: |
export ETHERSCAN_API_KEY=${{vars.ETHERSCAN_API_KEY}}
git clone https://github.com/uri-99/zksync-local-setup.git
echo git cloned
cd zksync-local-setup
echo starting Dockerized L1-L2
touch ../docker_output.log
./start.sh &> ../docker_output.log &
# Ethereum Setup
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Install Forge
run: |
cd contracts/ethereum
forge install
# ZKSync Setup
- name: Install ZKSync libraries
run: |
cd ./contracts/zksync/ && yarn install
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '20.11.1'
cache: 'npm'
cache-dependency-path: '**/.github/workflows/*.yml'
- name: Download zksync-cli
run: |
npx zksync-cli --version
# Build Ethereum Contract
- name: Build Ethereum Contract
run: |
make ethereum-build
# Build ZKSync Contract
- name: Build ZKSync Contract
run: |
make zksync-build
# Run Dockerized L1-L2
- name: Running integration test
run: |
export ETHERSCAN_API_KEY=${{vars.ETHERSCAN_API_KEY}}
export STARKNET_MESSAGING_ADDRESS=${{vars.STARKNET_MESSAGING_ADDRESS}}
export STARKNET_CLAIM_PAYMENT_SELECTOR=${{vars.STARKNET_CLAIM_PAYMENT_SELECTOR}}
export STARKNET_CLAIM_PAYMENT_BATCH_SELECTOR=${{vars.STARKNET_CLAIM_PAYMENT_BATCH_SELECTOR}}
export ZKSYNC_CLAIM_PAYMENT_SELECTOR=${{vars.ZKSYNC_CLAIM_PAYMENT_SELECTOR}}
export ZKSYNC_CLAIM_PAYMENT_BATCH_SELECTOR=${{vars.ZKSYNC_CLAIM_PAYMENT_BATCH_SELECTOR}}
export STARKNET_CHAIN_ID=${{vars.STARKNET_CHAIN_ID}}
export ZKSYNC_CHAIN_ID=${{vars.ZKSYNC_CHAIN_ID}}
export MM_ETHEREUM_WALLET_ADDRESS=${{vars.MM_ETHEREUM_WALLET_ADDRESS}}
export TEST=true
echo sleeping 250 to wait for ./start to setup
sleep 250
export ZKSYNC_DIAMOND_PROXY_ADDRESS=$(cat docker_output.log | sed -n 's/.*CONTRACTS_DIAMOND_PROXY_ADDR=\(0x[a-fA-F0-9]*\).*/\1/p')
echo stored ZKSYNC_DIAMOND_PROXY_ADDRESS variable:
echo $ZKSYNC_DIAMOND_PROXY_ADDRESS
echo running make-test-integration-ci
make zksync-test-integration-ci
exit 0