[2.0] Change references to eos #669
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 Node CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - release/* | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| override-cdt: | |
| description: 'Override cdt target' | |
| type: string | |
| override-cdt-prerelease: | |
| type: choice | |
| description: Override cdt prelease | |
| options: | |
| - default | |
| - true | |
| - false | |
| override-evm-contract: | |
| description: 'Override evm-contract target' | |
| type: string | |
| override-evm-contract-prerelease: | |
| type: choice | |
| description: Override evm-contract prelease | |
| options: | |
| - default | |
| - true | |
| - false | |
| override-evm-miner: | |
| description: 'Override evm-miner target' | |
| type: string | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| documentation: | |
| name: Attach Documentation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| submodules: 'false' | |
| - name: Attach Documentation | |
| run: cat .github/workflows/node.md >> $GITHUB_STEP_SUMMARY | |
| d: | |
| name: Discover Platforms | |
| runs-on: ubuntu-latest | |
| outputs: | |
| missing-platforms: ${{steps.discover.outputs.missing-platforms}} | |
| p: ${{steps.discover.outputs.platforms}} | |
| steps: | |
| - name: Discover Platforms | |
| id: discover | |
| uses: AntelopeIO/discover-platforms-action@v1 | |
| with: | |
| platform-file: .cicd/platforms.json | |
| password: ${{secrets.GITHUB_TOKEN}} | |
| package-name: builders | |
| build-platforms: | |
| name: Build Platforms | |
| needs: d | |
| if: needs.d.outputs.missing-platforms != '[]' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: ${{fromJSON(needs.d.outputs.missing-platforms)}} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| contents: read | |
| steps: | |
| - name: Login to Container Registry | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{github.repository_owner}} | |
| password: ${{secrets.GITHUB_TOKEN}} | |
| - name: Build and push | |
| uses: docker/build-push-action@v3 | |
| with: | |
| push: true | |
| tags: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}} | |
| file: ${{fromJSON(needs.d.outputs.p)[matrix.platform].dockerfile}} | |
| build: | |
| name: EOS EVM Node Build | |
| needs: [d, build-platforms] | |
| if: always() && needs.d.result == 'success' && (needs.build-platforms.result == 'success' || needs.build-platforms.result == 'skipped') | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: [ ubuntu22 ] | |
| runs-on: ubuntu-latest | |
| container: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}} | |
| steps: | |
| - name: Authenticate | |
| id: auth | |
| uses: AntelopeIO/github-app-token-action@v1 | |
| with: | |
| app_id: ${{ secrets.TRUSTEVM_CI_APP_ID }} | |
| private_key: ${{ secrets.TRUSTEVM_CI_APP_KEY }} | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: 'recursive' | |
| token: ${{ steps.auth.outputs.token }} | |
| - name: Build EVM Node | |
| run: .github/workflows/build-node.sh | |
| env: | |
| CC: gcc-11 | |
| CXX: g++-11 | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build.tar.gz | |
| path: build.tar.gz | |
| versions: | |
| name: Determine Versions | |
| runs-on: ubuntu-latest | |
| outputs: | |
| antelope-spring-dev-target: ${{steps.versions.outputs.antelope-spring-dev-target}} | |
| antelope-spring-dev-prerelease: ${{steps.versions.outputs.antelope-spring-dev-prerelease}} | |
| cdt-target: ${{steps.versions.outputs.cdt-target}} | |
| cdt-prerelease: ${{steps.versions.outputs.cdt-prerelease}} | |
| evm-contract-target: ${{steps.versions.outputs.evm-contract-target}} | |
| evm-contract-prerelease: ${{steps.versions.outputs.evm-contract-prerelease}} | |
| evm-miner-target: ${{steps.versions.outputs.evm-miner-target}} | |
| steps: | |
| - name: Setup versions from input or defaults | |
| id: versions | |
| env: | |
| GH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| run: | | |
| DEFAULTS_JSON=$(curl -sSfL $(gh api https://api.github.com/repos/${{github.repository}}/contents/.cicd/defaults.json?ref=${{github.sha}} --jq .download_url)) | |
| echo antelope-spring-dev-target=$(echo "$DEFAULTS_JSON" | jq -r '."antelope-spring-dev".target') >> $GITHUB_OUTPUT | |
| echo antelope-spring-dev-prerelease=$(echo "$DEFAULTS_JSON" | jq -r '."antelope-spring-dev".prerelease') >> $GITHUB_OUTPUT | |
| echo cdt-target=$(echo "$DEFAULTS_JSON" | jq -r '."cdt".target') >> $GITHUB_OUTPUT | |
| echo cdt-prerelease=$(echo "$DEFAULTS_JSON" | jq -r '."cdt".prerelease') >> $GITHUB_OUTPUT | |
| echo evm-contract-target=$(echo "$DEFAULTS_JSON" | jq -r '."evm-contract".target') >> $GITHUB_OUTPUT | |
| echo evm-contract-prerelease=$(echo "$DEFAULTS_JSON" | jq -r '."evm-contract".prerelease') >> $GITHUB_OUTPUT | |
| echo evm-miner-target=$(echo "$DEFAULTS_JSON" | jq -r '."evm-miner".target') >> $GITHUB_OUTPUT | |
| if [[ "${{inputs.override-cdt}}" != "" ]]; then | |
| echo cdt-target=${{inputs.override-cdt}} >> $GITHUB_OUTPUT | |
| fi | |
| if [[ "${{inputs.override-cdt-prerelease}}" == +(true|false) ]]; then | |
| echo cdt-prerelease=${{inputs.override-cdt-prerelease}} >> $GITHUB_OUTPUT | |
| fi | |
| if [[ "${{inputs.override-evm-contract}}" != "" ]]; then | |
| echo evm-contract-target=${{inputs.override-evm-contract}} >> $GITHUB_OUTPUT | |
| fi | |
| if [[ "${{inputs.override-evm-contract-prerelease}}" == +(true|false) ]]; then | |
| echo evm-contract-prerelease=${{inputs.override-evm-contract-prerelease}} >> $GITHUB_OUTPUT | |
| fi | |
| if [[ "${{inputs.override-evm-miner}}" != "" ]]; then | |
| echo evm-miner-target=${{inputs.override-evm-miner}} >> $GITHUB_OUTPUT | |
| fi | |
| integration-test: | |
| name: EOS EVM Integration Tests | |
| needs: [d, build, versions] | |
| if: always() && needs.d.result == 'success' && needs.build.result == 'success' && needs.versions.result == 'success' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: [ ubuntu22 ] | |
| runs-on: ubuntu-latest | |
| container: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}} | |
| env: | |
| CC: gcc-11 | |
| CXX: g++-11 | |
| DCMAKE_BUILD_TYPE: 'Release' | |
| steps: | |
| - name: Update Package Index & Upgrade Packages | |
| run: | | |
| apt-get update | |
| apt-get upgrade -y | |
| apt update | |
| apt upgrade -y | |
| - name: Download cdt | |
| uses: AntelopeIO/asset-artifact-download-action@v3 | |
| with: | |
| owner: AntelopeIO | |
| repo: cdt | |
| file: 'cdt_.*amd64.deb' | |
| target: '${{needs.versions.outputs.cdt-target}}' | |
| prereleases: ${{fromJSON(needs.versions.outputs.cdt-prerelease)}} | |
| artifact-name: cdt_ubuntu_package_amd64 | |
| - name: Download antelope-spring-dev | |
| uses: AntelopeIO/asset-artifact-download-action@v3 | |
| with: | |
| owner: AntelopeIO | |
| repo: spring | |
| file: 'antelope-spring-dev.*ubuntu22\.04_amd64.deb' | |
| target: '${{needs.versions.outputs.antelope-spring-dev-target}}' | |
| prereleases: ${{fromJSON(needs.versions.outputs.antelope-spring-dev-prerelease)}} | |
| artifact-name: antelope-spring-dev-ubuntu22-amd64 | |
| container-package: antelope-spring-experimental-binaries | |
| - name: Download antelope-spring binary | |
| uses: AntelopeIO/asset-artifact-download-action@v3 | |
| with: | |
| owner: AntelopeIO | |
| repo: spring | |
| file: 'antelope-spring_.*_amd64.deb' | |
| target: '${{needs.versions.outputs.antelope-spring-dev-target}}' | |
| prereleases: ${{fromJSON(needs.versions.outputs.antelope-spring-dev-prerelease)}} | |
| artifact-name: antelope-spring-deb-amd64 | |
| - name: Install packages | |
| run: | | |
| apt-get update && apt-get upgrade -y | |
| apt install -y ./*.deb | |
| apt-get install -y cmake | |
| rm ./*.deb | |
| echo "=== after install packages ===" | |
| ls -ltr /usr | |
| ls -ltr /usr/bin/ | |
| ls -ltr /usr/lib/ | |
| ls -ltr /usr/share/ | |
| echo "=== files in /usr/share/spring_testing ===" | |
| ls -ltr /usr/share/spring_testing/ | |
| echo "=== files in /usr/share/spring_testing/bin ===" | |
| ls -ltr /usr/share/spring_testing/bin/ | |
| - name: Link Spring TestHarness Module | |
| run: ln -s /usr/share/spring_testing/tests/TestHarness /usr/lib/python3/dist-packages/TestHarness | |
| - name: Download EVM Contract | |
| uses: AntelopeIO/asset-artifact-download-action@v3 | |
| with: | |
| owner: VaultaFoundation | |
| repo: evm-contract | |
| target: '${{needs.versions.outputs.evm-contract-target}}' | |
| prereleases: ${{fromJSON(needs.versions.outputs.evm-contract-prerelease)}} | |
| file: 'contract.tar.gz' | |
| artifact-name: contract.test-actions-off.tar.gz | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract EVM Contract | |
| id: evm-contract | |
| run: | | |
| mkdir contract | |
| mv contract.tar.gz contract/ | |
| cd contract | |
| tar xvf contract.tar.gz | |
| cd build | |
| echo "EVM_CONTRACT=$(pwd)" >> "$GITHUB_OUTPUT" | |
| - name: Authenticate | |
| id: auth | |
| uses: AntelopeIO/github-app-token-action@v1 | |
| with: | |
| app_id: ${{ secrets.TRUSTEVM_CI_APP_ID }} | |
| private_key: ${{ secrets.TRUSTEVM_CI_APP_KEY }} | |
| - name: Checkout evm-miner | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: VaultaFoundation/evm-miner | |
| path: evm-miner | |
| ref: '${{needs.versions.outputs.evm-miner-target}}' | |
| - name: Download EVM Node builddir | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build.tar.gz | |
| - name: Extract EVM Node builddir | |
| id: evm-node-build | |
| run: | | |
| mkdir evm-node | |
| mv build.tar.gz evm-node/ | |
| pushd evm-node | |
| tar xvf build.tar.gz | |
| pushd build | |
| echo "EVM_NODE_BUILD=$(pwd)" >> "$GITHUB_OUTPUT" | |
| popd | |
| - name: Install Test Dependencies | |
| run: | | |
| pip install --upgrade web3 | |
| pip install otree | |
| apt install -y wget | |
| wget https://nodejs.org/dist/v18.17.0/node-v18.17.0-linux-x64.tar.xz | |
| tar xvfJ node-v18.17.0-linux-x64.tar.xz | |
| cp -r node-v18.17.0-linux-x64/{bin,include,lib,share} /usr/ | |
| node --version | |
| npm --version | |
| - name: Build evm-miner | |
| id: evm-miner-build | |
| run: | | |
| pushd evm-miner | |
| echo "EVM_MINER_ROOT=$(pwd)" >> "$GITHUB_OUTPUT" | |
| npm install | |
| npm run build | |
| popd | |
| - name: Test Leap Integration | |
| run: | | |
| mkdir test_run_root | |
| cd test_run_root | |
| ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/tests/nodeos_eos_evm_test.py -v --evm-contract-root ${{ steps.evm-contract.outputs.EVM_CONTRACT }} --evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} --use-miner ${{ steps.evm-miner-build.outputs.EVM_MINER_ROOT }} | |
| - name: Test Leap Integration - with Brownie Framework | |
| run: | | |
| mkdir -p test_run_root | |
| cd test_run_root | |
| pip install --upgrade web3 | |
| pip install otree | |
| pip install websocket-client | |
| pip install eth-brownie | |
| npm install -g ganache | |
| pip install flask | |
| pip install flask-cors --upgrade | |
| brownie networks add Ethereum localhost5000 host=http://127.0.0.1:5000 chainid=15555 | |
| ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/tests/nodeos_eos_evm_brownietest.py -v --evm-contract-root ${{ steps.evm-contract.outputs.EVM_CONTRACT }} --evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} --use-miner ${{ steps.evm-miner-build.outputs.EVM_MINER_ROOT }} --flask-proxy-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/tests/ | |
| - name: Test Leap Integration - different gas token | |
| run: | | |
| mkdir -p test_run_root | |
| cd test_run_root | |
| ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/tests/nodeos_eos_evm_different_token_test.py -v --evm-contract-root ${{ steps.evm-contract.outputs.EVM_CONTRACT }} --evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} --use-miner ${{ steps.evm-miner-build.outputs.EVM_MINER_ROOT }} | |
| - name: Test Web-Socket Integration | |
| run: | | |
| echo "=== current directory is $(pwd)===" | |
| apt-get install psmisc | |
| killall -9 nodeos || true | |
| killall -9 evm-node || true | |
| killall -9 evm-rpc || true | |
| sleep 1.0 | |
| mkdir -p ws_test_run_root | |
| cd ws_test_run_root | |
| pip install --upgrade web3 | |
| pip install otree | |
| pip install websocket-client | |
| pushd ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} | |
| cd peripherals/eos-evm-ws-proxy | |
| npm install env | |
| npm install dotenv | |
| npm install winston | |
| npm install ws | |
| npm install uuid | |
| npm install axios | |
| npm install web3 | |
| npm install collections | |
| popd | |
| ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/tests/nodeos_eos_evm_ws_test_basic.py -v --evm-contract-root ${{ steps.evm-contract.outputs.EVM_CONTRACT }} --evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} | |
| - name: Test Web-Socket Fork Handling | |
| run: | | |
| echo "=== current directory is $(pwd)===" | |
| apt-get install psmisc | |
| killall -9 nodeos || true | |
| killall -9 evm-node || true | |
| killall -9 evm-rpc || true | |
| sleep 1.0 | |
| mkdir -p ws_test_run_root | |
| cd ws_test_run_root | |
| pip install --upgrade web3 | |
| pip install otree | |
| pip install websocket-client | |
| pushd ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} | |
| cd peripherals/eos-evm-ws-proxy | |
| npm install env | |
| npm install dotenv | |
| npm install winston | |
| npm install ws | |
| npm install uuid | |
| npm install axios | |
| npm install web3 | |
| npm install collections | |
| popd | |
| ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/tests/nodeos_eos_evm_ws_test_fork.py -v --evm-contract-root ${{ steps.evm-contract.outputs.EVM_CONTRACT }} --evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} | |
| - name: Test Gas Parameter Fork Handling | |
| run: | | |
| echo "=== current directory is $(pwd)===" | |
| apt-get install psmisc | |
| killall -9 nodeos || true | |
| killall -9 evm-node || true | |
| killall -9 evm-rpc || true | |
| sleep 1.0 | |
| mkdir -p ws_test_run_root | |
| cd ws_test_run_root | |
| pip install --upgrade web3 | |
| pip install otree | |
| pip install websocket-client | |
| pushd ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} | |
| cd peripherals/eos-evm-ws-proxy | |
| npm install env | |
| npm install dotenv | |
| npm install winston | |
| npm install ws | |
| npm install uuid | |
| npm install axios | |
| npm install web3 | |
| npm install collections | |
| popd | |
| ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/tests/nodeos_eos_evm_gasparam_fork_test.py -v --evm-contract-root ${{ steps.evm-contract.outputs.EVM_CONTRACT }} --evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} | |
| - name: Prepare Logs | |
| if: failure() | |
| run: | | |
| tar -czf sprint-int-test-logs.tar.gz test_run_root/* ws_test_run_root/* | |
| - name: Upload logs from failed tests | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: spring-int-test-logs.tar.gz | |
| path: spring-int-test-logs.tar.gz |