From fa771e16b858a78b08abe904888040427c7fb17b Mon Sep 17 00:00:00 2001 From: yarkin Date: Wed, 6 Dec 2023 00:20:40 +0800 Subject: [PATCH 01/14] Fix a comile issue. --- cmd/common/rpcdaemon_options.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/common/rpcdaemon_options.cpp b/cmd/common/rpcdaemon_options.cpp index 2936eb1d..bd947c5c 100644 --- a/cmd/common/rpcdaemon_options.cpp +++ b/cmd/common/rpcdaemon_options.cpp @@ -101,7 +101,7 @@ void add_rpcdaemon_options(CLI::App& cli, silkworm::rpc::DaemonSettings& setting cli.add_flag("--rpc_quirk_flag", settings.rpc_quirk_flag) ->description("Flag controling quirk modes for rpc APIs") - ->check(CLI::Range(0, UINT64_MAX)) + ->check(CLI::Range(uint64_t(0), UINT64_MAX)) ->capture_default_str(); } From b2fa122283fc3265dd6d8a701e716da8e16ec7ea Mon Sep 17 00:00:00 2001 From: yarkin Date: Wed, 6 Dec 2023 00:20:59 +0800 Subject: [PATCH 02/14] Fix trace tests --- silkworm/silkrpc/core/evm_trace_test.cpp | 30 +++++++++++++++--------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/silkworm/silkrpc/core/evm_trace_test.cpp b/silkworm/silkrpc/core/evm_trace_test.cpp index bc21beab..5b5cf3c6 100644 --- a/silkworm/silkrpc/core/evm_trace_test.cpp +++ b/silkworm/silkrpc/core/evm_trace_test.cpp @@ -2585,7 +2585,7 @@ TEST_CASE_METHOD(TraceCallExecutorTest, "TraceCallExecutor::trace_block") { "action": { "author": "0x0000000000000000000000000000000000000000", "rewardType": "block", - "value": "0x1bc16d674ec80000" + "value": "0x0" }, "blockHash": "0x527198f474c1f1f1d01129d3a17ecc17895d85884a31b05ef0ecd480faee1592", "blockNumber": 1024165, @@ -3843,18 +3843,26 @@ TEST_CASE_METHOD(TraceCallExecutorTest, "TraceCallExecutor::trace_filter") { })); // TransactionDatabase::walk: TABLE BlockTransaction - static Bytes kBlockTransactionKey1{*silkworm::from_hex("0000000005c62e67")}; + static Bytes kBlockTransactionKey1{*silkworm::from_hex("0000000005c62e66")}; static uint32_t kBlockTransactionFixedBits1{0}; EXPECT_CALL(db_reader, walk(db::table::kBlockTransactionsName, silkworm::ByteView{kBlockTransactionKey1}, kBlockTransactionFixedBits1, _)) - .WillOnce(InvokeWithoutArgs([]() -> boost::asio::awaitable { + .WillRepeatedly(InvokeWithoutArgs([]() -> boost::asio::awaitable { co_return; })); // TransactionDatabase::walk: TABLE BlockTransaction - static Bytes kBlockTransactionKey2{*silkworm::from_hex("0000000005c62e6a")}; + static Bytes kBlockTransactionKey2{*silkworm::from_hex("0000000005c62e69")}; static uint32_t kBlockTransactionFixedBits2{0}; EXPECT_CALL(db_reader, walk(db::table::kBlockTransactionsName, silkworm::ByteView{kBlockTransactionKey2}, kBlockTransactionFixedBits2, _)) - .WillOnce(InvokeWithoutArgs([]() -> boost::asio::awaitable { + .WillRepeatedly(InvokeWithoutArgs([]() -> boost::asio::awaitable { + co_return; + })); + + // TransactionDatabase::walk: TABLE BlockTransaction + static Bytes kBlockTransactionKey3{*silkworm::from_hex("0000000005c62e6f")}; + static uint32_t kBlockTransactionFixedBits3{0}; + EXPECT_CALL(db_reader, walk(db::table::kBlockTransactionsName, silkworm::ByteView{kBlockTransactionKey3}, kBlockTransactionFixedBits3, _)) + .WillRepeatedly(InvokeWithoutArgs([]() -> boost::asio::awaitable { co_return; })); @@ -5343,7 +5351,7 @@ TEST_CASE_METHOD(TraceCallExecutorTest, "TraceCallExecutor::trace_filter") { "action": { "author": "0x0000000000000000000000000000000000000000", "rewardType": "block", - "value": "0x1bc16d674ec80000" + "value": "0x0" }, "blockHash": "0xa87009e08f9af73efe86d702561afcf98f277a8acec60b97869969e367c12d66", "blockNumber": 7200002, @@ -5356,7 +5364,7 @@ TEST_CASE_METHOD(TraceCallExecutorTest, "TraceCallExecutor::trace_filter") { "action": { "author": "0x0000000000000000000000000000000000000000", "rewardType": "block", - "value": "0x1bc16d674ec80000" + "value": "0x0" }, "blockHash": "0xa316f156582fb5fba2166910becdb6342965a801fa473e18cd6a0c06143cac1a", "blockNumber": 7200003, @@ -5529,7 +5537,7 @@ TEST_CASE_METHOD(TraceCallExecutorTest, "TraceCallExecutor::trace_filter") { "action": { "author": "0x0000000000000000000000000000000000000000", "rewardType": "block", - "value": "0x1bc16d674ec80000" + "value": "0x0" }, "blockHash": "0xa87009e08f9af73efe86d702561afcf98f277a8acec60b97869969e367c12d66", "blockNumber": 7200002, @@ -5600,7 +5608,7 @@ TEST_CASE_METHOD(TraceCallExecutorTest, "TraceCallExecutor::trace_filter") { "action": { "author": "0x0000000000000000000000000000000000000000", "rewardType": "block", - "value": "0x1bc16d674ec80000" + "value": "0x0" }, "blockHash": "0xa87009e08f9af73efe86d702561afcf98f277a8acec60b97869969e367c12d66", "blockNumber": 7200002, @@ -5613,7 +5621,7 @@ TEST_CASE_METHOD(TraceCallExecutorTest, "TraceCallExecutor::trace_filter") { "action": { "author": "0x0000000000000000000000000000000000000000", "rewardType": "block", - "value": "0x1bc16d674ec80000" + "value": "0x0" }, "blockHash": "0xa316f156582fb5fba2166910becdb6342965a801fa473e18cd6a0c06143cac1a", "blockNumber": 7200003, @@ -5684,7 +5692,7 @@ TEST_CASE_METHOD(TraceCallExecutorTest, "TraceCallExecutor::trace_filter") { "action": { "author": "0x0000000000000000000000000000000000000000", "rewardType": "block", - "value": "0x1bc16d674ec80000" + "value": "0x0" }, "blockHash": "0xa316f156582fb5fba2166910becdb6342965a801fa473e18cd6a0c06143cac1a", "blockNumber": 7200003, From 595b41126472a14af16007222714977b41cb824c Mon Sep 17 00:00:00 2001 From: yarkin Date: Wed, 6 Dec 2023 00:21:16 +0800 Subject: [PATCH 03/14] Fix warnings in gas estimation tests. --- silkworm/silkrpc/core/estimate_gas_oracle_test.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/silkworm/silkrpc/core/estimate_gas_oracle_test.cpp b/silkworm/silkrpc/core/estimate_gas_oracle_test.cpp index 1211c8cb..6497cd52 100644 --- a/silkworm/silkrpc/core/estimate_gas_oracle_test.cpp +++ b/silkworm/silkrpc/core/estimate_gas_oracle_test.cpp @@ -390,9 +390,8 @@ TEST_CASE("estimate gas") { try { EXPECT_CALL(estimate_gas_oracle, try_execution(_, _, _)) - .Times(3) - .WillOnce(Return(expect_result_fail_pre_check)) - .WillRepeatedly(Return(expect_result_fail)); + .Times(1) + .WillOnce(Return(expect_result_fail_pre_check)); auto result = boost::asio::co_spawn(pool, estimate_gas_oracle.estimate_gas(call, block), boost::asio::use_future); result.get(); CHECK(false); @@ -415,9 +414,8 @@ TEST_CASE("estimate gas") { try { EXPECT_CALL(estimate_gas_oracle, try_execution(_, _, _)) - .Times(3) - .WillOnce(Return(expect_result_fail_pre_check)) - .WillRepeatedly(Return(expect_result_fail)); + .Times(1) + .WillOnce(Return(expect_result_fail_pre_check)); auto result = boost::asio::co_spawn(pool, estimate_gas_oracle.estimate_gas(call, block), boost::asio::use_future); result.get(); CHECK(false); From b52b3c27f0aa7b81ebd14e6101a61b30298b2a0d Mon Sep 17 00:00:00 2001 From: yarkin Date: Wed, 6 Dec 2023 00:38:03 +0800 Subject: [PATCH 04/14] Try ci script. --- .cicd/defaults.json | 3 + .cicd/platforms.json | 5 + .cicd/platforms/ubuntu22.Dockerfile | 11 + .circleci/config.yml | 388 ---------------------------- .github/workflows/macOS.yml | 82 ------ .github/workflows/node.md | 53 ++++ .github/workflows/node.yml | 170 ++++++++++++ .github/workflows/windows.yml | 75 ------ 8 files changed, 242 insertions(+), 545 deletions(-) create mode 100644 .cicd/defaults.json create mode 100644 .cicd/platforms.json create mode 100644 .cicd/platforms/ubuntu22.Dockerfile delete mode 100644 .circleci/config.yml delete mode 100644 .github/workflows/macOS.yml create mode 100644 .github/workflows/node.md create mode 100644 .github/workflows/node.yml delete mode 100644 .github/workflows/windows.yml diff --git a/.cicd/defaults.json b/.cicd/defaults.json new file mode 100644 index 00000000..deaa69b8 --- /dev/null +++ b/.cicd/defaults.json @@ -0,0 +1,3 @@ +{ + +} diff --git a/.cicd/platforms.json b/.cicd/platforms.json new file mode 100644 index 00000000..2b0c8c46 --- /dev/null +++ b/.cicd/platforms.json @@ -0,0 +1,5 @@ +{ + "ubuntu22": { + "dockerfile": ".cicd/platforms/ubuntu22.Dockerfile" + } + } diff --git a/.cicd/platforms/ubuntu22.Dockerfile b/.cicd/platforms/ubuntu22.Dockerfile new file mode 100644 index 00000000..0bce4565 --- /dev/null +++ b/.cicd/platforms/ubuntu22.Dockerfile @@ -0,0 +1,11 @@ +FROM ubuntu:jammy +ENV TZ="America/New_York" +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && apt-get upgrade -y && \ + apt-get install -y build-essential \ + cmake \ + gcc-11 \ + g++-11 \ + git \ + python3-pip +RUN pip install -v "conan==1.60.2" diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 6e9745d2..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,388 +0,0 @@ -# Copyright 2020 The Silkworm Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -version: 2.1 - -commands: - checkout_with_submodules: - parameters: - ethereum_tests: - description: Include a heavy Ethereum tests submodule if needed. - type: boolean - default: true - steps: - - checkout - - run: - name: "Update submodules" - command: | - if [[ <> == false ]] - then - git config submodule.tests.update none - fi - - git submodule sync - git -c submodule.LegacyTests.update=none submodule update --init --recursive - - build: - parameters: - build_type: - type: string - default: Release - compiler_id: - type: string - compiler_version: - type: integer - conan_profile: - type: string - default: none - steps: - - run: - name: "Install compiler" - command: cmake/setup/compiler_install.sh <> <> - - run: - name: "Install dependencies" - command: | - sudo apt-get update - sudo apt-get install -y m4 texinfo bison - - run: - name: "Cmake" - working_directory: ~/build - command: | - if [[ "<>" != "none" ]] - then - CONAN_CMAKE_ARGS="-DCONAN_PROFILE=<>" - fi - if [[ "<>" == "clang" ]] - then - TOOLCHAIN_CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=../project/cmake/toolchain/clang_libcxx.cmake" - fi - - cmake ../project -DCMAKE_BUILD_TYPE=<> $CONAN_CMAKE_ARGS $TOOLCHAIN_CMAKE_ARGS $BUILD_CMAKE_ARGS - - run: - name: "Build" - command: cmake --build ~/build -j8 # each compiler job requires 4GB of RAM - - build_using_conan: - parameters: - build_type: - type: string - default: Release - compiler_id: - type: string - compiler_version: - type: integer - steps: - - run: - name: "Install Conan" - command: sudo pip3 install conan==1.58.0 chardet - - run: - name: "Select Conan profile" - command: | - if [[ "<>" == "clang" ]] - then - conan_profile=linux_clang_13_release - else - conan_profile=linux_gcc_11_release - fi - echo "export CONAN_PROFILE='$conan_profile'" >> "$BASH_ENV" - cp "cmake/profiles/$conan_profile" "$HOME/selected_conan_profile" - - restore_cache: - name: "Restore Conan cache" - key: &conan-cache-key conan-machine-{{ .Environment.CIRCLE_JOB }}-<>-<>-{{checksum "../selected_conan_profile"}}-{{checksum "conanfile.txt"}} - - build: - build_type: <> - compiler_id: <> - compiler_version: <> - conan_profile: $CONAN_PROFILE - - save_cache: - name: "Save Conan cache" - key: *conan-cache-key - paths: - - ~/.conan - - test: - parameters: - ethereum_tests: - type: boolean - default: true - steps: - - run: - name: "Unit tests" - command: make "SILKWORM_BUILD_DIR=$HOME/build" run_unit_tests - - when: - condition: <> - steps: - - run: - name: "Ethereum EL tests" - working_directory: ~/build - no_output_timeout: 30m - command: cmd/test/ethereum --threads 8 - -jobs: - lint: - machine: - image: ubuntu-2204:2023.04.2 - steps: - - add_ssh_keys: - fingerprints: - - "4b:13:8d:15:b9:98:1a:dc:96:c2:b9:ab:fa:c1:d4:e6" - - checkout - - run: - name: "Format" - working_directory: ~/project - command: | - sudo pip install cmake-format==0.6.13 - make fmt - if ! git diff --exit-code - then - commit_message="make fmt" - head_commit_message="$(git log -1 --pretty=%B)" - - if [[ "$head_commit_message" == "$commit_message" ]] - then - echo "The formatting style is not compliant, although it was formatted. Try to run 'make fmt' locally and push the changes." - exit 1 - else - git config user.name GitHub - git config user.email noreply@github.com - git commit --all --message="$commit_message" - git config push.autoSetupRemote true - git push - - echo "The formatting style was not compliant, but it is fixed now. A new workflow will start soon, wait for it..." - exit 2 - fi - fi - - run: - name: "Copyright" - working_directory: ~/project - command: cmake -P cmake/copyright.cmake - - linux-gcc-thread-sanitizer: - environment: - BUILD_CMAKE_ARGS: -DSILKWORM_SANITIZE=thread - machine: - image: ubuntu-2204:2023.04.2 - resource_class: xlarge - steps: - - checkout_with_submodules - - build_using_conan: - compiler_id: gcc - compiler_version: <> - build_type: Debug - - test - - linux-release: - parameters: - compiler_id: - type: string - compiler_version: - type: integer - ethereum_tests: - type: boolean - default: true - machine: - image: ubuntu-2204:2023.04.2 - resource_class: xlarge - steps: - - checkout_with_submodules: - ethereum_tests: <> - - build_using_conan: - compiler_id: <> - compiler_version: <> - - test: - ethereum_tests: <> - - linux-clang-address-sanitizer: - environment: - BUILD_CMAKE_ARGS: -DSILKWORM_SANITIZE=address,undefined - ASAN_OPTIONS: alloc_dealloc_mismatch=0 # https://github.com/llvm/llvm-project/issues/59432 - UBSAN_OPTIONS: print_stacktrace=1 - machine: - image: ubuntu-2204:2023.04.2 - resource_class: xlarge - steps: - - checkout_with_submodules - - build_using_conan: - build_type: Debug - compiler_id: clang - compiler_version: <> - - test - - linux-clang-coverage: - environment: - BUILD_CMAKE_ARGS: -DSILKWORM_CLANG_COVERAGE=ON - machine: - image: ubuntu-2204:2023.04.2 - resource_class: xlarge - steps: - - checkout_with_submodules - - build_using_conan: - build_type: Debug - compiler_id: clang - compiler_version: <> - - run: - name: "Unit tests" - command: make "SILKWORM_BUILD_DIR=$HOME/build" SILKWORM_CLANG_COVERAGE=ON run_unit_tests - - run: - name: "Ethereum EL tests" - no_output_timeout: 30m - command: LLVM_PROFILE_FILE=ethereum.profraw ~/build/cmd/test/ethereum - - run: - name: "Coverage" - command: | - llvm-profdata merge *.profraw -o profdata - llvm-cov export -instr-profile profdata ~/build/cmd/silkworm '-ignore-filename-regex=(third_party|silkworm/interfaces|test)' -format=lcov > /tmp/silkworm.lcov - llvm-cov report -instr-profile profdata ~/build/cmd/silkworm '-ignore-filename-regex=(third_party|silkworm/interfaces|test)' > /tmp/report.txt - - store_artifacts: - path: /tmp/silkworm.lcov - - store_artifacts: - path: /tmp/report.txt - - linux-clang-tidy: - environment: - # see: https://clang.llvm.org/extra/clang-tidy/ - BUILD_CMAKE_ARGS: -DSILKWORM_CLANG_TIDY=ON - machine: - image: ubuntu-2204:2023.04.2 - resource_class: xlarge - steps: - - run: - name: "Install clang-tidy" - command: | - sudo apt-get update - sudo apt-get install -y clang-tidy - - checkout_with_submodules: - ethereum_tests: false - - build_using_conan: - build_type: Debug - compiler_id: clang - compiler_version: 14 - - run: - name: "Generate report" - command: | - sudo pip install clang-html - curl --output build.log "https://circleci.com/api/v1.1/project/github/torquem-ch/silkworm/$CIRCLE_BUILD_NUM/output/110/0?file=true" - clang-tidy-html build.log -o /tmp/report.html - - store_artifacts: - path: /tmp/report.html - - linux-wasm-build: - environment: - WASI_SDK_VERSION: 14 - machine: - image: ubuntu-2204:2023.04.2 - steps: - - checkout_with_submodules: - ethereum_tests: false - - run: - name: "Install WASI SDK" - working_directory: ~/tmp1 - command: | - wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$WASI_SDK_VERSION/wasi-sdk-$WASI_SDK_VERSION.0-linux.tar.gz - tar xvf wasi-sdk-$WASI_SDK_VERSION.0-linux.tar.gz - sudo mv wasi-sdk-$WASI_SDK_VERSION.0 /opt/wasi-sdk - - run: - name: "Install dependencies" - command: | - sudo apt-get update - sudo apt-get install -y texinfo libtinfo5 - - run: - name: "Install Conan" - command: sudo pip3 install conan==1.58.0 chardet - - run: - name: "Install Wasmer" - working_directory: ~/tmp2 - command: $HOME/project/third_party/wasmer/install.sh v3.2.1 - - run: - name: "Build GMP" - working_directory: ~/tmp3 - command: | - git clone https://github.com/torquem-ch/gmp-wasm - cd gmp-wasm - git checkout 87e9087 - ./configure --prefix $HOME/opt-wasm CC=/opt/wasi-sdk/bin/clang --host=none AR=llvm-ar RANLIB=llvm-ranlib --enable-cxx CXX=/opt/wasi-sdk/bin/clang++ ABI=longlong - make -j - make install - - run: - name: "Cmake" - working_directory: ~/build - command: | - sed -i.bak '/grpc/d' ../project/conanfile.txt # remove GRPC dependencies to avoid building them - cmake ../project -DCMAKE_TOOLCHAIN_FILE=$HOME/project/cmake/toolchain/wasi.cmake -DSILKWORM_CORE_ONLY=ON -DSILKWORM_CORE_USE_ABSEIL=OFF -DSILKWORM_WASM_API=ON -DGMP_INCLUDE_DIR=$HOME/opt-wasm/include -DGMP_LIBRARY=$HOME/opt-wasm/lib/libgmp.a -DCMAKE_BUILD_TYPE=Release - - run: - name: "Build" - command: cmake --build ~/build -j - - run: - name: "Core unit tests" - working_directory: ~/build - command: wasmer cmd/test/core_test --stack-size 16777216 - -parameters: - clang_version_min: - type: integer - default: 13 - clang_version_latest: - type: integer - default: 15 - gcc_version_min: - type: integer - default: 11 - gcc_version_latest: - type: integer - default: 12 - -workflows: - version: 2 - - light: - when: - not: - equal: [ master, <> ] - jobs: - - lint - - linux-release: - name: linux-gcc-<>-release - compiler_id: gcc - compiler_version: <> - ethereum_tests: false - requires: - - lint - - linux-release: - name: linux-clang-<>-release - compiler_id: clang - compiler_version: <> - ethereum_tests: false - requires: - - lint - - integration: - when: - or: - - equal: [ master, <> ] - - matches: { pattern: "^ci\\/.+$", value: <> } - jobs: - - linux-release: - name: linux-gcc-<>-release - compiler_id: gcc - compiler_version: <> - - linux-release: - name: linux-clang-<>-release - compiler_id: clang - compiler_version: <> - - linux-gcc-thread-sanitizer - - linux-clang-coverage - - linux-clang-address-sanitizer - - linux-clang-tidy - - linux-wasm-build diff --git a/.github/workflows/macOS.yml b/.github/workflows/macOS.yml deleted file mode 100644 index 49e7174d..00000000 --- a/.github/workflows/macOS.yml +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright 2023 The Silkworm Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: macOS - -on: - push: - branches: - - master - - 'ci/**' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - osx: - runs-on: macOS-latest - - # Disable on external PRs - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository - - strategy: - matrix: - config: - - {build_type: "Release"} - fail-fast: false # This makes it so that if 1 of the tests in the matrix fail, they don't all fail - - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - fetch-depth: "0" - - - name: Install Prerequisites - run: | - brew install gmp - pip3 install --user conan==1.58.0 chardet - echo "$HOME/Library/Python/$(ls $HOME/Library/Python)/bin" >> "$GITHUB_PATH" - - - name: Create Build Environment - # Some projects don't allow in-source building, so create a separate build directory - # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/build - - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.config.cc }}-${{ matrix.config.build_type }} # Eg. "linux_x64-ubuntu-latest-clang-12-Debug" - - - name: Configure CMake - working-directory: ${{runner.workspace}}/build - env: - CC: ${{ matrix.config.cc}} - CXX: ${{ matrix.config.cxx}} - run: | - export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" - cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} - - - name: Build - working-directory: ${{runner.workspace}}/build - # Execute the build. You can specify a specific target with "--target " - run: cmake --build . --config ${{ matrix.config.build_type }} -j 2 - - - name: Unit tests - run: make "SILKWORM_BUILD_DIR=${{runner.workspace}}/build" run_unit_tests - - - name: Ethereum EL tests - working-directory: ${{runner.workspace}}/build - run: | - cmd/test/ethereum --threads 4 diff --git a/.github/workflows/node.md b/.github/workflows/node.md new file mode 100644 index 00000000..42949f81 --- /dev/null +++ b/.github/workflows/node.md @@ -0,0 +1,53 @@ +# EOS EVM Silkworm CI +This GitHub Actions workflow builds all silkworm modules + +### Index +1. [Triggers](#triggers) +1. [Inputs](#inputs) +1. [Steps](#steps) +1. [Outputs](#outputs) +1. [See Also](#see-also) + +## Triggers +This GitHub action will run under the following circumstances: +1. When code is pushed. +1. Workflow dispatch event, a manual CI run, which can be triggered by the "Workflow Dispatch" button in the Actions tab of the GitHub repository, among other means. + +## Inputs +The inputs for this GitHub action are: +1. `GITHUB_TOKEN` - a GitHub Actions intrinsic used to access the repository and other public resources. +1. `TRUSTEVM_CI_APP_ID` - the app ID of the `trustevm-ci-submodule-checkout` GitHub App. +1. `TRUSTEVM_CI_APP_KEY` - the private key to the `trustevm-ci-submodule-checkout` GitHub App. +1. `upload-artifacts` - a boolean input that specifies whether or not to upload the artifacts of the build. The default value is `false`. This can be overridden in manual CI runs. + +These inputs are used in various steps of the workflow to perform actions such as authentication, downloading artifacts, configuring the build, and uploading artifacts. + +## Steps +This workflow performs the following steps: +1. Attach Documentation + 1. Checkout the repo with no submodules. + 1. Attach an annotation to the GitHub Actions build summary page containing CI documentation. +1. EOS EVM Node Build + 1. Authenticate to the `trustevm-ci-submodule-checkout` GitHub app using the [AntelopeIO/github-app-token-action](https://github.com/AntelopeIO/github-app-token-action) action to obtain an ephemeral token. + 1. Checkout the repo and submodules using the ephemeral token. + 1. Build using `cmake` and `make`. + 1. Upload the build folder to GitHub Actions if the `upload-artifacts` input is set to `true`. + +## Outputs +This workflow produces the following outputs: +1. Build Artifacts - `build.tar.gz` containing the built artifacts of eos-evm-node and eos-evm-rpc, if the `upload-artifacts` input is set to `true`. + +> 💾️ Build artifacts are only attached on-demand for this pipeline because they are >117 MB each, but we only get 2 GB of cumulative artifact storage in GitHub Actions while eos-evm is a private repo. Obtain artifacts by performing a manual build with `upload-artifacts` set to `true`. + +## See Also +- [github-app-token-action](https://github.com/AntelopeIO/github-app-token-action) GitHub action +- [EOS EVM Documentation](../../README.md) + +For assistance with the CI system, please open an issue in this repo or reach out in the `#help-automation` channel via IM. + +*** +**_Legal notice_** +This document was generated in collaboration with ChatGPT from OpenAI, a machine learning algorithm or weak artificial intelligence (AI). At the time of this writing, the [OpenAI terms of service agreement](https://openai.com/terms) §3.a states: +> Your Content. You may provide input to the Services (“Input”), and receive output generated and returned by the Services based on the Input (“Output”). Input and Output are collectively “Content.” As between the parties and to the extent permitted by applicable law, you own all Input, and subject to your compliance with these Terms, OpenAI hereby assigns to you all its right, title and interest in and to Output. + +This notice is required in some countries. diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml new file mode 100644 index 00000000..a296d665 --- /dev/null +++ b/.github/workflows/node.yml @@ -0,0 +1,170 @@ +name: EOS EVM Node CI + +on: + push: + branches: + - main + - release/* + pull_request: + workflow_dispatch: + +defaults: + run: + shell: bash + +jobs: + documentation: + name: Attach Documentation + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + 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@v3 + with: + fetch-depth: 0 + submodules: 'recursive' + token: ${{ steps.auth.outputs.token }} + + - name: Build EOS EVM Node + run: .github/workflows/build-node.sh + env: + CC: gcc-11 + CXX: g++-11 + + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: build.tar.gz + path: build.tar.gz + + 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: 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: Download EOS EVM Node builddir + uses: actions/download-artifact@v3 + with: + name: build.tar.gz + + - name: Extract EOS EVM Node builddir + id: evm-node-build + run: | + mkdir silkworm + mv build.tar.gz silkworm/ + pushd silkworm + tar xvf build.tar.gz + pushd build + echo "EVM_NODE_BUILD=$(pwd)" >> "$GITHUB_OUTPUT" + popd + + - name: Test rpcdaemon_test + run: | + mkdir test_run_root + cd test_run_root + ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/cmd/test/rpcdaemon_test + + - name: Prepare Logs + if: failure() + run: | + tar -czf leap-int-test-logs.tar.gz test_run_root/* ws_test_run_root/* + + - name: Upload logs from failed tests + uses: actions/upload-artifact@v3 + if: failure() + with: + name: leap-int-test-logs.tar.gz + path: leap-int-test-logs.tar.gz diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100644 index fa49e34f..00000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright 2023 The Silkworm Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: Windows - -on: - push: - branches: - - master - - 'ci/**' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - windows: - runs-on: windows-latest - - # Disable on external PRs - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository - - strategy: - matrix: - config: - - {build_type: "Release"} - fail-fast: false # This makes it so that if 1 of the tests in the matrix fail, they don't all fail - - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - fetch-depth: "0" - - - name: Install Conan - id: conan - uses: turtlebrowser/get-conan@main - with: - version: 1.59.0 - - - name: Create Build Environment - # Some projects don't allow in-source building, so create a separate build directory - # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory C:\build - - - name: Configure CMake - working-directory: C:\build - run: cmake ${{runner.workspace}}\silkworm -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} - - - name: Build unit tests - working-directory: C:\build - run: cmake --build . --config ${{ matrix.config.build_type }} --target all_unit_tests -j 1 - - - name: Build Ethereum EL tests - working-directory: C:\build - run: cmake --build . --config ${{ matrix.config.build_type }} --target ethereum -j 2 - - - name: Unit tests - run: cmake -DSILKWORM_BUILD_DIR=C:\build -P cmake\run_unit_tests.cmake - - - name: Ethereum EL tests - working-directory: C:\build - run: | - cmd/test/${{ matrix.config.build_type }}/ethereum --threads 4 From abf3cae3516cfb277c9ec00717a585091a13daae Mon Sep 17 00:00:00 2001 From: yarkin Date: Wed, 6 Dec 2023 00:41:05 +0800 Subject: [PATCH 05/14] Fix ci. --- .github/workflows/node.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index a296d665..850f95e9 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -107,7 +107,7 @@ jobs: integration-test: name: EOS EVM Integration Tests - needs: [d, build, versions] + needs: [d, build] if: always() && needs.d.result == 'success' && needs.build.result == 'success' && needs.versions.result == 'success' strategy: fail-fast: false From b51216c550b9ea730571639da56c24a1a9760d51 Mon Sep 17 00:00:00 2001 From: yarkin Date: Wed, 6 Dec 2023 10:02:05 +0800 Subject: [PATCH 06/14] Update ci scripts. --- .github/workflows/node.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 850f95e9..2cfd9e08 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -79,12 +79,12 @@ jobs: 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: 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@v3 @@ -128,12 +128,12 @@ jobs: apt update apt upgrade -y - - 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: 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: Download EOS EVM Node builddir uses: actions/download-artifact@v3 From 19ac95fbd77a086f13214521d91959d781f94b9a Mon Sep 17 00:00:00 2001 From: yarkin Date: Wed, 6 Dec 2023 10:04:55 +0800 Subject: [PATCH 07/14] Update CI scripts. --- .github/workflows/node.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 2cfd9e08..ad351377 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -91,7 +91,7 @@ jobs: with: fetch-depth: 0 submodules: 'recursive' - token: ${{ steps.auth.outputs.token }} + token: ${{secrets.GITHUB_TOKEN}} - name: Build EOS EVM Node run: .github/workflows/build-node.sh From 0f106dee2f1357ef605fdb1f9de252a8d51f84af Mon Sep 17 00:00:00 2001 From: yarkin Date: Wed, 6 Dec 2023 10:12:50 +0800 Subject: [PATCH 08/14] Add missing file. --- .github/workflows/build-node.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 .github/workflows/build-node.sh diff --git a/.github/workflows/build-node.sh b/.github/workflows/build-node.sh new file mode 100755 index 00000000..1af8f7ce --- /dev/null +++ b/.github/workflows/build-node.sh @@ -0,0 +1,26 @@ +#!/bin/bash +set -eo pipefail + +# print and run a command +function ee() +{ + echo "$ $*" + eval "$@" +} + +# debug code +echo "CC='${CC}'" +echo "CXX='${CXX}'" +ee cmake --version + +# build +ee mkdir build +ee pushd build +ee cmake .. +ee make -j "$(nproc)" + +# pack +ee popd +ee 'tar -czf build.tar.gz --exclude="*.o" build/*' + +echo "Done! - ${0##*/}" From 5fb8dccceeee6a4a80fe95a68a2f0554b476d7e0 Mon Sep 17 00:00:00 2001 From: yarkin Date: Wed, 6 Dec 2023 18:31:11 +0800 Subject: [PATCH 09/14] Update CI scripts. --- .github/workflows/node.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index ad351377..30b72206 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -108,7 +108,7 @@ jobs: integration-test: name: EOS EVM Integration Tests needs: [d, build] - if: always() && needs.d.result == 'success' && needs.build.result == 'success' && needs.versions.result == 'success' + if: always() && needs.d.result == 'success' && needs.build.result == 'success' strategy: fail-fast: false matrix: @@ -157,6 +157,30 @@ jobs: cd test_run_root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/cmd/test/rpcdaemon_test + - name: Test core_test + run: | + mkdir test_run_root + cd test_run_root + ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/cmd/test/core_test + + - name: Test infra_test + run: | + mkdir test_run_root + cd test_run_root + ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/cmd/test/infra_test + + - name: Test node_test + run: | + mkdir test_run_root + cd test_run_root + ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/cmd/test/node_test + + - name: Test sync_test + run: | + mkdir test_run_root + cd test_run_root + ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/cmd/test/sync_test + - name: Prepare Logs if: failure() run: | From 2c98239af08bdce0afa4409fe0babf23c8cd2b76 Mon Sep 17 00:00:00 2001 From: yarkin Date: Wed, 6 Dec 2023 19:36:10 +0800 Subject: [PATCH 10/14] Update CI scripts. --- .github/workflows/build-node.sh | 2 +- .github/workflows/node.md | 6 ++-- .github/workflows/node.yml | 49 +++++++++++++-------------------- 3 files changed, 23 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build-node.sh b/.github/workflows/build-node.sh index 1af8f7ce..f17438f4 100755 --- a/.github/workflows/build-node.sh +++ b/.github/workflows/build-node.sh @@ -21,6 +21,6 @@ ee make -j "$(nproc)" # pack ee popd -ee 'tar -czf build.tar.gz --exclude="*.o" build/*' +ee 'tar -czf build.tar.gz build/cmd/test/*_test' echo "Done! - ${0##*/}" diff --git a/.github/workflows/node.md b/.github/workflows/node.md index 42949f81..13a0764c 100644 --- a/.github/workflows/node.md +++ b/.github/workflows/node.md @@ -27,15 +27,15 @@ This workflow performs the following steps: 1. Attach Documentation 1. Checkout the repo with no submodules. 1. Attach an annotation to the GitHub Actions build summary page containing CI documentation. -1. EOS EVM Node Build +1. EOS EVM Siklworm Build 1. Authenticate to the `trustevm-ci-submodule-checkout` GitHub app using the [AntelopeIO/github-app-token-action](https://github.com/AntelopeIO/github-app-token-action) action to obtain an ephemeral token. 1. Checkout the repo and submodules using the ephemeral token. 1. Build using `cmake` and `make`. - 1. Upload the build folder to GitHub Actions if the `upload-artifacts` input is set to `true`. + 1. Upload the test binaries to GitHub Actions if the `upload-artifacts` input is set to `true`. ## Outputs This workflow produces the following outputs: -1. Build Artifacts - `build.tar.gz` containing the built artifacts of eos-evm-node and eos-evm-rpc, if the `upload-artifacts` input is set to `true`. +1. Build Artifacts - `build.tar.gz` containing the built artifacts of unit tests of the silkworm project, if the `upload-artifacts` input is set to `true`. Note that only tests are included as we do not really care about other binaries for this repo. > 💾️ Build artifacts are only attached on-demand for this pipeline because they are >117 MB each, but we only get 2 GB of cumulative artifact storage in GitHub Actions while eos-evm is a private repo. Obtain artifacts by performing a manual build with `upload-artifacts` set to `true`. diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 30b72206..00034de0 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -1,4 +1,4 @@ -name: EOS EVM Node CI +name: EOS EVM Silkworm CI on: push: @@ -68,7 +68,7 @@ jobs: file: ${{fromJSON(needs.d.outputs.p)[matrix.platform].dockerfile}} build: - name: EOS EVM Node Build + name: EOS EVM Silkworm Build needs: [d, build-platforms] if: always() && needs.d.result == 'success' && (needs.build-platforms.result == 'success' || needs.build-platforms.result == 'skipped') strategy: @@ -93,7 +93,7 @@ jobs: submodules: 'recursive' token: ${{secrets.GITHUB_TOKEN}} - - name: Build EOS EVM Node + - name: Build EOS EVM Silkworm run: .github/workflows/build-node.sh env: CC: gcc-11 @@ -105,8 +105,8 @@ jobs: name: build.tar.gz path: build.tar.gz - integration-test: - name: EOS EVM Integration Tests + unit-test: + name: EOS EVM Silkworm Unit Tests needs: [d, build] if: always() && needs.d.result == 'success' && needs.build.result == 'success' strategy: @@ -135,60 +135,49 @@ jobs: # app_id: ${{ secrets.TRUSTEVM_CI_APP_ID }} # private_key: ${{ secrets.TRUSTEVM_CI_APP_KEY }} - - name: Download EOS EVM Node builddir + - name: Download EOS EVM Silkworm builddir uses: actions/download-artifact@v3 with: name: build.tar.gz - - name: Extract EOS EVM Node builddir - id: evm-node-build + - name: Extract EOS EVM Silkworm builddir + id: evm-silkworm-build run: | mkdir silkworm mv build.tar.gz silkworm/ pushd silkworm tar xvf build.tar.gz pushd build - echo "EVM_NODE_BUILD=$(pwd)" >> "$GITHUB_OUTPUT" + echo "EVM_SILKWORM_BUILD=$(pwd)" >> "$GITHUB_OUTPUT" popd - name: Test rpcdaemon_test run: | - mkdir test_run_root + mkdir -p test_run_root cd test_run_root - ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/cmd/test/rpcdaemon_test + ${{ steps.evm-silkworm-build.outputs.EVM_SILKWORM_BUILD }}/cmd/test/rpcdaemon_test - name: Test core_test run: | - mkdir test_run_root + mkdir -p test_run_root cd test_run_root - ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/cmd/test/core_test + ${{ steps.evm-silkworm-build.outputs.EVM_SILKWORM_BUILD }}/cmd/test/core_test - name: Test infra_test run: | - mkdir test_run_root + mkdir -p test_run_root cd test_run_root - ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/cmd/test/infra_test + ${{ steps.evm-silkworm-build.outputs.EVM_SILKWORM_BUILD }}/cmd/test/infra_test - name: Test node_test run: | - mkdir test_run_root + mkdir -p test_run_root cd test_run_root - ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/cmd/test/node_test + ${{ steps.evm-silkworm-build.outputs.EVM_SILKWORM_BUILD }}/cmd/test/node_test - name: Test sync_test run: | - mkdir test_run_root + mkdir -p test_run_root cd test_run_root - ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/cmd/test/sync_test + ${{ steps.evm-silkworm-build.outputs.EVM_SILKWORM_BUILD }}/cmd/test/sync_test - - name: Prepare Logs - if: failure() - run: | - tar -czf leap-int-test-logs.tar.gz test_run_root/* ws_test_run_root/* - - - name: Upload logs from failed tests - uses: actions/upload-artifact@v3 - if: failure() - with: - name: leap-int-test-logs.tar.gz - path: leap-int-test-logs.tar.gz From 9fe4aa264f106d0c279eacbdcdeddd77ceb5b18a Mon Sep 17 00:00:00 2001 From: yarkin Date: Wed, 6 Dec 2023 20:55:12 +0800 Subject: [PATCH 11/14] Update CI --- .github/workflows/build-node.sh | 2 +- .github/workflows/node.yml | 25 ++++++++++--------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-node.sh b/.github/workflows/build-node.sh index f17438f4..7e3256de 100755 --- a/.github/workflows/build-node.sh +++ b/.github/workflows/build-node.sh @@ -17,7 +17,7 @@ ee cmake --version ee mkdir build ee pushd build ee cmake .. -ee make -j "$(nproc)" +ee make all_unit_tests -j "$(nproc)" # pack ee popd diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 00034de0..79e1eea8 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -153,31 +153,26 @@ jobs: - name: Test rpcdaemon_test run: | - mkdir -p test_run_root - cd test_run_root - ${{ steps.evm-silkworm-build.outputs.EVM_SILKWORM_BUILD }}/cmd/test/rpcdaemon_test + cd ${{ steps.evm-silkworm-build.outputs.EVM_SILKWORM_BUILD }}/cmd/test/ + ./rpcdaemon_test - name: Test core_test run: | - mkdir -p test_run_root - cd test_run_root - ${{ steps.evm-silkworm-build.outputs.EVM_SILKWORM_BUILD }}/cmd/test/core_test + cd ${{ steps.evm-silkworm-build.outputs.EVM_SILKWORM_BUILD }}/cmd/test/ + ./core_test - name: Test infra_test run: | - mkdir -p test_run_root - cd test_run_root - ${{ steps.evm-silkworm-build.outputs.EVM_SILKWORM_BUILD }}/cmd/test/infra_test + cd ${{ steps.evm-silkworm-build.outputs.EVM_SILKWORM_BUILD }}/cmd/test/ + ./infra_test - name: Test node_test run: | - mkdir -p test_run_root - cd test_run_root - ${{ steps.evm-silkworm-build.outputs.EVM_SILKWORM_BUILD }}/cmd/test/node_test + cd ${{ steps.evm-silkworm-build.outputs.EVM_SILKWORM_BUILD }}/cmd/test/ + ./node_test - name: Test sync_test run: | - mkdir -p test_run_root - cd test_run_root - ${{ steps.evm-silkworm-build.outputs.EVM_SILKWORM_BUILD }}/cmd/test/sync_test + cd ${{ steps.evm-silkworm-build.outputs.EVM_SILKWORM_BUILD }}/cmd/test/ + ./sync_test From d18048aebee2f20e85cf60c537872ce909645054 Mon Sep 17 00:00:00 2001 From: yarkin Date: Fri, 8 Dec 2023 11:06:01 +0800 Subject: [PATCH 12/14] Build everything in CI. --- .github/workflows/build-node.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-node.sh b/.github/workflows/build-node.sh index 7e3256de..f17438f4 100755 --- a/.github/workflows/build-node.sh +++ b/.github/workflows/build-node.sh @@ -17,7 +17,7 @@ ee cmake --version ee mkdir build ee pushd build ee cmake .. -ee make all_unit_tests -j "$(nproc)" +ee make -j "$(nproc)" # pack ee popd From b192ea4341f6e8607ed559fe7935442485707844 Mon Sep 17 00:00:00 2001 From: yarkin Date: Fri, 8 Dec 2023 13:18:57 +0800 Subject: [PATCH 13/14] Rename some files. --- .github/workflows/{build-node.sh => build-tests.sh} | 0 .github/workflows/{node.md => silkworm.md} | 0 .github/workflows/{node.yml => silkworm.yml} | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{build-node.sh => build-tests.sh} (100%) rename .github/workflows/{node.md => silkworm.md} (100%) rename .github/workflows/{node.yml => silkworm.yml} (97%) diff --git a/.github/workflows/build-node.sh b/.github/workflows/build-tests.sh similarity index 100% rename from .github/workflows/build-node.sh rename to .github/workflows/build-tests.sh diff --git a/.github/workflows/node.md b/.github/workflows/silkworm.md similarity index 100% rename from .github/workflows/node.md rename to .github/workflows/silkworm.md diff --git a/.github/workflows/node.yml b/.github/workflows/silkworm.yml similarity index 97% rename from .github/workflows/node.yml rename to .github/workflows/silkworm.yml index 79e1eea8..8bd5dba4 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/silkworm.yml @@ -24,7 +24,7 @@ jobs: submodules: 'false' - name: Attach Documentation - run: cat .github/workflows/node.md >> $GITHUB_STEP_SUMMARY + run: cat .github/workflows/siklworm.md >> $GITHUB_STEP_SUMMARY d: name: Discover Platforms @@ -94,7 +94,7 @@ jobs: token: ${{secrets.GITHUB_TOKEN}} - name: Build EOS EVM Silkworm - run: .github/workflows/build-node.sh + run: .github/workflows/build-tests.sh env: CC: gcc-11 CXX: g++-11 From 57673bf59eb67ebd4b4907cab990f316d1f7f7fe Mon Sep 17 00:00:00 2001 From: yarkin Date: Fri, 8 Dec 2023 13:21:03 +0800 Subject: [PATCH 14/14] Fix typo --- .github/workflows/silkworm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/silkworm.yml b/.github/workflows/silkworm.yml index 8bd5dba4..30df960c 100644 --- a/.github/workflows/silkworm.yml +++ b/.github/workflows/silkworm.yml @@ -24,7 +24,7 @@ jobs: submodules: 'false' - name: Attach Documentation - run: cat .github/workflows/siklworm.md >> $GITHUB_STEP_SUMMARY + run: cat .github/workflows/silkworm.md >> $GITHUB_STEP_SUMMARY d: name: Discover Platforms