Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test build evm tests suite #80

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions .github/workflows/tests-evm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: EVM test suite

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
preflight:
uses: ./.github/workflows/reusable-preflight.yml

evm-test-suite:
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
if: ${{ needs.preflight.outputs.changes_rust }}
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.IMAGE }}
env:
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: "-C debug-assertions"
RUST_BACKTRACE: 1
steps:
- name: Checkout
uses: actions/checkout@v4

- name: script
run: |
forklift cargo build --locked --profile production -p pallet-revive-eth-rpc --bin eth-rpc
forklift cargo build --bin substrate-node
# forklift cargo build --locked --profile testnet --features pyroscope,fast-runtime --bin polkadot-execute-worker
# forklift cargo build --locked --profile testnet --features pyroscope,fast-runtime --bin polkadot-prepare-worker

- name: Checkout evm-tests
uses: actions/checkout@v4
with:
repository: paritytech/evm-test-suite
ref: 6f95f703b1bc25d7eb2ca9377bd2c422e7a50ce9
path: evm-test-suite

- uses: actions/setup-node@v4
with:
node-version: 22

- name: script
run: |
echo "Change to the evm-test-suite directory"
cd evm-test-suite
echo "Download the resolc binary"
wget https://github.com/paritytech/revive/releases/download/v0.1.0-dev.9/resolc -q
chmod +x resolc
mv resolc /usr/local/bin
resolc --version

echo "Check that binaries are in place"
export NODE_BIN_PATH=$(readlink -f ../target/debug/substrate-node)
export ETH_RPC_PATH=$(readlink -f ../target/production/eth-rpc)
export RESOLC_PATH=/usr/local/bin/resolc
echo $NODE_BIN_PATH $ETH_RPC_PATH $RESOLC_PATH

echo "Install npm dependencies"
npm install
# cat matter-labs-tests/hardhat.config.ts | grep batchSize

echo "Installing solc"
wget https://github.com/ethereum/solidity/releases/download/v0.8.28/solc-static-linux -q
chmod +x solc-static-linux
mv solc-static-linux /usr/local/bin/solc
echo "Run the tests"
sed -i 's/batchSize: 300,/batchSize: 100,/' matter-labs-tests/hardhat.config.ts
echo "bash init.sh --kitchensink -- --matter-labs -- $NODE_BIN_PATH $ETH_RPC_PATH $RESOLC_PATH"
bash init.sh --kitchensink -- --matter-labs -- $NODE_BIN_PATH $ETH_RPC_PATH $RESOLC_PATH

- name: Collect tests results
if: always()
uses: actions/upload-artifact@v4
with:
name: evm-test-suite-${{ github.sha }}
path: evm-test-suite/test-logs/matter-labs-tests.log

confirm-required-test-evm-jobs-passed:
runs-on: ubuntu-latest
name: All test misc tests passed
# If any new job gets added, be sure to add it to this array
needs:
- evm-test-suite
if: always() && !cancelled()
steps:
- run: |
tee resultfile <<< '${{ toJSON(needs) }}'
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
if [ $FAILURES -gt 0 ]; then
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
exit 1
else
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
fi
Loading