forked from paritytech/polkadot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 1
100 lines (89 loc) · 3.46 KB
/
tests-evm.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
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 --locked --profile testnet --features pyroscope,fast-runtime --bin polkadot
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: 14b2b9af243b70a938404e6366df0ce364d74232
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
chmod +x resolc
echo "Install npm dependencies"
npm install
echo "Check that binaries are in place"
NODE_BIN_PATH=$(readlink -f ../target/testnet/polkadot)
ETH_RPC_PATH=$(readlink -f ../target/production/eth-rpc)
RESOLC_PATH=$(readlink -f ./resolc)
NODE_PATH=$(readlink -f ../target/testnet/polkadot)
ADAPTER_PATH=$(readlink -f ../target/production/eth-rpc)
COMPILER_PATH=$(readlink -f ./resolc)
echo $NODE_BIN_PATH $ETH_RPC_PATH $RESOLC_PATH
echo "Run the tests"
# bash init.sh --kitchensink -- --matter-labs -- $NODE_BIN_PATH $ETH_RPC_PATH $RESOLC_PATH
cd matter-labs-tests
npm install --force
npx hardhat node
- 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