Introduce API for directly importing the state into the database #21330
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: EVM test suite | |
| on: | |
| push: | |
| branches: | |
| - master | |
| 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: | |
| ["revive-dev-node-revm-solc", "revive-dev-node-polkavm-resolc"] | |
| steps: | |
| - name: Checkout the Polkadot SDK | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - 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 | |
| - name: Building the dependencies from the Polkadot SDK | |
| run: forklift cargo build --locked --profile release -p pallet-revive-eth-rpc -p revive-dev-node | |
| - name: Checkout the Differential Tests Repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| repository: paritytech/revive-differential-tests | |
| ref: 66feb36b4ef2c79415ca8ea765d8235d48dfa8f8 | |
| path: revive-differential-tests | |
| submodules: recursive | |
| - name: Installing Retester | |
| run: forklift 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.1/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 100 \ | |
| --working-directory ./workdir \ | |
| --revive-dev-node.consensus manual-seal-200 \ | |
| --revive-dev-node.path ./target/release/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@b7c566a772e6b6bfb58ed0dc250532a479d7789f | |
| 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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: script | |
| run: | | |
| forklift cargo build --locked --release -p pallet-revive-eth-rpc --bin eth-rpc | |
| forklift cargo build --locked --release -p revive-dev-node --bin revive-dev-node | |
| - name: Checkout evm-tests | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| repository: paritytech/evm-test-suite | |
| ref: f3a2e98620adfc233166728230247d479a159e76 | |
| 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/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 -E '"result": "(failure|cancelled)"' | 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 |