From 224b6e5a2bb11d7a36440344e481f84414ba876a Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Tue, 1 Aug 2023 13:22:44 -0500 Subject: [PATCH] Add tests and peripherals into the build. Having tests and peripherals in the build allows simply downloading the archived build artifact and having everything necessary to run integration tests. Update node.yaml workflow for using only the build artifact. It no longer needs to clone the eos-evm-node repository. --- .github/workflows/node.yml | 29 ++++--------------- CMakeLists.txt | 2 ++ peripherals/CMakeLists.txt | 1 + peripherals/tx_wrapper/CMakeLists.txt | 4 +++ tests/CMakeLists.txt | 5 ++++ tests/nodeos_eos_evm_server/CMakeLists.txt | 7 +++++ .../contracts/CMakeLists.txt | 9 ++++++ .../scripts/CMakeLists.txt | 7 +++++ 8 files changed, 40 insertions(+), 24 deletions(-) create mode 100644 peripherals/CMakeLists.txt create mode 100644 peripherals/tx_wrapper/CMakeLists.txt create mode 100644 tests/CMakeLists.txt create mode 100644 tests/nodeos_eos_evm_server/CMakeLists.txt create mode 100644 tests/nodeos_eos_evm_server/contracts/CMakeLists.txt create mode 100644 tests/nodeos_eos_evm_server/scripts/CMakeLists.txt diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index ea91d88..27f5c00 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -200,14 +200,6 @@ jobs: app_id: ${{ secrets.TRUSTEVM_CI_APP_ID }} private_key: ${{ secrets.TRUSTEVM_CI_APP_KEY }} - - name: Checkout EOS EVM Node Repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - submodules: 'recursive' - token: ${{ steps.auth.outputs.token }} - path: eos-evm-node - - name: Download EOS EVM Node builddir uses: actions/download-artifact@v3 with: @@ -216,18 +208,13 @@ jobs: - name: Extract EOS EVM Node builddir id: evm-node-build run: | - pwd - ls - pushd eos-evm-node/peripherals/tx_wrapper - echo "EVM_NODE_TX_WRAPPER=$(pwd)" >> "$GITHUB_OUTPUT" - popd + mkdir eos-evm-node mv build.tar.gz eos-evm-node/ - cd eos-evm-node - ls - echo "EVM_NODE_ROOT=$(pwd)" >> "$GITHUB_OUTPUT" + pushd eos-evm-node tar xvf build.tar.gz - cd build + pushd build echo "EVM_NODE_BUILD=$(pwd)" >> "$GITHUB_OUTPUT" + popd - name: Install Test Depedencies run: | @@ -259,13 +246,7 @@ jobs: ls ${{ steps.evm-contract.outputs.EVM_CONTRACT }} echo "See if build root still looks good." ls ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} - echo "See if tx_wrapper still looks good." - ls ${{ steps.evm-node-build.outputs.EVM_NODE_TX_WRAPPER }} - echo "See if node root still looks good." - ls ${{ steps.evm-node-build.outputs.EVM_NODE_ROOT }} - echo "See if node root tests still looks good." - ls ${{ steps.evm-node-build.outputs.EVM_NODE_ROOT }}/tests - ${{ steps.evm-node-build.outputs.EVM_NODE_ROOT }}/tests/nodeos_eos_evm_test.py -v --eos-evm-contract-root ${{ steps.evm-contract.outputs.EVM_CONTRACT }} --eos-evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} --use-tx-wrapper ${{ steps.evm-node-build.outputs.EVM_NODE_TX_WRAPPER }} + ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/tests/nodeos_eos_evm_test.py -v --eos-evm-contract-root ${{ steps.evm-contract.outputs.EVM_CONTRACT }} --eos-evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} --use-tx-wrapper ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/peripherals/tx_wrapper - name: Prepare Logs if: failure() diff --git a/CMakeLists.txt b/CMakeLists.txt index eac606a..9354013 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,3 +29,5 @@ endif() add_subdirectory(external) add_subdirectory(version) add_subdirectory(src) +add_subdirectory(peripherals) +add_subdirectory(tests) diff --git a/peripherals/CMakeLists.txt b/peripherals/CMakeLists.txt new file mode 100644 index 0000000..73fa698 --- /dev/null +++ b/peripherals/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory( tx_wrapper ) \ No newline at end of file diff --git a/peripherals/tx_wrapper/CMakeLists.txt b/peripherals/tx_wrapper/CMakeLists.txt new file mode 100644 index 0000000..2bbd2e3 --- /dev/null +++ b/peripherals/tx_wrapper/CMakeLists.txt @@ -0,0 +1,4 @@ +configure_file( index.js . COPYONLY ) +configure_file( package-lock.json . COPYONLY ) +configure_file( package.json . COPYONLY ) +configure_file( yarn.lock . COPYONLY ) \ No newline at end of file diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000..cb905e4 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,5 @@ +add_subdirectory( nodeos_eos_evm_server ) + +configure_file(antelope_name.py . COPYONLY) +configure_file(nodeos_eos_evm_server.py . COPYONLY) +configure_file(nodeos_eos_evm_test.py . COPYONLY) \ No newline at end of file diff --git a/tests/nodeos_eos_evm_server/CMakeLists.txt b/tests/nodeos_eos_evm_server/CMakeLists.txt new file mode 100644 index 0000000..9615f79 --- /dev/null +++ b/tests/nodeos_eos_evm_server/CMakeLists.txt @@ -0,0 +1,7 @@ +add_subdirectory( contracts ) +add_subdirectory( scripts ) + +configure_file( extract-logtime-cmd.sh . COPYONLY ) +configure_file( hardhat.config.js . COPYONLY ) +configure_file( package.json . COPYONLY ) +configure_file( yarn.lock . COPYONLY ) \ No newline at end of file diff --git a/tests/nodeos_eos_evm_server/contracts/CMakeLists.txt b/tests/nodeos_eos_evm_server/contracts/CMakeLists.txt new file mode 100644 index 0000000..cddeb1e --- /dev/null +++ b/tests/nodeos_eos_evm_server/contracts/CMakeLists.txt @@ -0,0 +1,9 @@ +configure_file( BlockNum.sol . COPYONLY ) +configure_file( Blockhash.sol . COPYONLY ) +configure_file( CMakeLists.txt . COPYONLY ) +configure_file( Eventor.sol . COPYONLY ) +configure_file( Lock.sol . COPYONLY ) +configure_file( Recursive.sol . COPYONLY ) +configure_file( Storage.sol . COPYONLY ) +configure_file( Token.sol . COPYONLY ) +configure_file( WEOS.sol . COPYONLY ) \ No newline at end of file diff --git a/tests/nodeos_eos_evm_server/scripts/CMakeLists.txt b/tests/nodeos_eos_evm_server/scripts/CMakeLists.txt new file mode 100644 index 0000000..89b2a76 --- /dev/null +++ b/tests/nodeos_eos_evm_server/scripts/CMakeLists.txt @@ -0,0 +1,7 @@ +configure_file( deploy-blockhash.js . COPYONLY ) +configure_file( deploy-blocknum.js . COPYONLY ) +configure_file( deploy-eventor.js . COPYONLY ) +configure_file( deploy-recursive.js . COPYONLY ) +configure_file( deploy-token.js . COPYONLY ) +configure_file( deploy-uniswap.js . COPYONLY ) +configure_file( deploy.js . COPYONLY ) \ No newline at end of file