name: EVM test suite on: push: branches: - main pull_request: types: [opened, synchronize, reopened, ready_for_review] merge_group: workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: isdraft: uses: ./.github/workflows/reusable-isdraft.yml preflight: needs: isdraft uses: ./.github/workflows/reusable-preflight.yml differential-tests: needs: [preflight] runs-on: ${{ needs.preflight.outputs.RUNNER }} if: ${{ needs.preflight.outputs.changes_rust }} timeout-minutes: 60 container: image: ${{ needs.preflight.outputs.IMAGE }} permissions: pull-requests: write strategy: matrix: platform: ["pez-revive-dev-node-revm-solc", "pez-revive-dev-node-polkavm-resolc"] steps: - name: Checkout the Pezkuwi SDK uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Update the Installed Python run: apt-get update && apt-get install -y python3-pip python3 - name: Installing the Latest Resolc run: | VERSION="0.5.0" ASSET_URL="https://github.com/paritytech/revive/releases/download/v$VERSION/resolc-x86_64-unknown-linux-musl" echo "Downloading resolc v$VERSION from $ASSET_URL" curl -Lsf --show-error -o resolc "$ASSET_URL" chmod +x resolc ./resolc --version # NOTE: wasm32v1-none target removed - serde_core + Rust 1.88 bug # wasm-builder will fallback to wasm32-unknown-unknown automatically - name: Building the dependencies from the Pezkuwi SDK run: cargo build --locked --profile release -p pezpallet-revive-eth-rpc -p pez-revive-dev-node - name: Checkout the Differential Tests Repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: repository: pezkuwichain/revive-differential-tests ref: main path: revive-differential-tests submodules: recursive - name: Installing Retester run: cargo install --locked --path revive-differential-tests/crates/core - name: Creating a workdir for retester run: mkdir workdir - name: Downloading & Initializing the compilation caches run: | curl -fL --retry 3 --retry-all-errors --connect-timeout 10 -o cache.tar.gz "https://github.com/paritytech/revive-differential-tests/releases/download/compilation-caches-v1.0/cache.tar.gz" tar -zxf cache.tar.gz -C ./workdir > /dev/null 2>&1 - name: Running the Differential Tests run: | retester test \ --test ./revive-differential-tests/resolc-compiler-tests/fixtures/solidity/simple \ --test ./revive-differential-tests/resolc-compiler-tests/fixtures/solidity/complex \ --test ./revive-differential-tests/resolc-compiler-tests/fixtures/solidity/translated_semantic_tests \ --platform ${{ matrix.platform }} \ --concurrency.number-of-nodes 10 \ --concurrency.number-of-threads 10 \ --concurrency.number-of-concurrent-tasks 1000 \ --working-directory ./workdir \ --pez-revive-dev-node.consensus manual-seal-200 \ --pez-revive-dev-node.path ./target/release/pez-revive-dev-node \ --eth-rpc.path ./target/release/eth-rpc \ --resolc.path ./resolc - name: Creating a markdown report of the test execution run: | mv ./workdir/*.json report.json python3 ./.github/scripts/process-differential-tests-report.py report.json ${{ matrix.platform }} # We upload the report as an artifact to the run since there could be # certain cases where the report is too long to post as a Github comment. # This happens if the all of the tests are failing and therefore the # report exceeds the maximum allowed length of github comments - name: Upload the Report to the CI uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 with: name: report-${{ matrix.platform }}.md path: report.md - name: Posting the report as a comment on the PR uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 if: ${{ contains(github.event.pull_request.labels.*.name, 'T7-smart_contracts') }} with: header: diff-tests-report-${{ matrix.platform }} path: report.md 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 strategy: matrix: platform: ["test:pvm", "test:evm"] steps: - name: Checkout uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 # NOTE: wasm32v1-none target removed - serde_core + Rust 1.88 bug # wasm-builder will fallback to wasm32-unknown-unknown automatically - name: script run: | cargo build --locked --release -p pezpallet-revive-eth-rpc --bin eth-rpc cargo build --locked --release -p pez-revive-dev-node --bin pez-revive-dev-node - name: Checkout evm-tests uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: repository: paritytech/evm-test-suite ref: 9359438a13e8ab68f73320724f8783e170ecc193 path: evm-test-suite - uses: denoland/setup-deno@v2 with: deno-version: v2.x - name: script run: | echo "Change to the evm-test-suite directory" cd evm-test-suite deno --version echo "Check that binaries are in place" export REVIVE_DEV_NODE_PATH=$(readlink -f ../target/release/pez-revive-dev-node) export ETH_RPC_PATH=$(readlink -f ../target/release/eth-rpc) echo $REVIVE_DEV_NODE_PATH $ETH_RPC_PATH echo "== Running tests ==" START_REVIVE_DEV_NODE=true START_ETH_RPC=true deno task ${{ matrix.platform }} 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