From 0bcafb7b59c88804f7828a10edbecb06e3e07b50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Fri, 19 Feb 2021 12:30:21 +0100 Subject: [PATCH] ci: Add Silkworm-driven consensus tests --- circle.yml | 100 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 88 insertions(+), 12 deletions(-) diff --git a/circle.yml b/circle.yml index 5c0b72b1ba..75a0936899 100644 --- a/circle.yml +++ b/circle.yml @@ -15,6 +15,62 @@ executors: xcode: 11.1.0 commands: + build_silkworm: + steps: + - restore_cache: + name: "Restore Silkworm cache" + key: &silkworm-cache-key silkworm-v1 + - run: + name: "Check Silkworm cache" + command: | + if [ -f ~/silkworm/consensus ]; then + echo 'Cached Silkworm binary available - skip build.' + else + echo 'export SILKWORM_BUILD=true' >> $BASH_ENV + fi + - run: + name: "Install GMP-dev" + command: | + [ "$SILKWORM_BUILD" = true ] || exit 0 + sudo apt-get -q update && sudo apt-get -qy install --no-install-recommends libgmp-dev + - run: + name: "Checkout Silkworm" + working_directory: ~/silkworm/src + command: | + [ "$SILKWORM_BUILD" = true ] || exit 0 + git clone --no-checkout --single-branch https://github.com/torquem-ch/silkworm.git . + git checkout 614fabfcf19b8e06f0dcbe3e9af2345dcf748f3e + git submodule init + git submodule deinit tests + git submodule update --recursive --depth=1 --progress + - run: + name: "Configure Silkworm" + working_directory: ~/silkworm + command: | + [ "$SILKWORM_BUILD" = true ] || exit 0 + cmake -S src -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=$(pwd) + - run: + name: "Build Silkworm cmd/consensus" + working_directory: ~/silkworm + command: | + [ "$SILKWORM_BUILD" = true ] || exit 0 + cmake --build build --parallel --target consensus + - save_cache: + name: "Save Silkworm cache" + key: *silkworm-cache-key + paths: + - ~/silkworm/consensus + + download_consensus_tests: + parameters: + rev: + type: string + steps: + - run: + name: "Download consensus tests: <>" + working_directory: ~/tests + command: curl -L https://github.com/ethereum/tests/archive/<>.tar.gz | tar -xz --strip=1 + build: description: "Build" steps: @@ -115,6 +171,15 @@ commands: paths: - evmone-* + unpack_package: + steps: + - attach_workspace: + at: ~/package + - run: + name: "Unpack evmone" + working_directory: ~/package + command: tar xz < evmone*.tar.gz + jobs: lint: @@ -173,6 +238,19 @@ jobs: echo $name ghr -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME -n "$name" $prerelease_flag $CIRCLE_TAG ~/package + consensus-tests: + environment: + TESTS_REV: v7.0.0 + executor: linux-gcc-latest + steps: + - build_silkworm + - unpack_package + - download_consensus_tests: + rev: v7.0.0 + - run: + name: "Silkworm-driven consensus tests" + command: ~/silkworm/consensus --evm ~/package/lib/libevmone.so --tests ~/tests + state-tests: environment: TESTS_REV: ac8cf2cd8ba326d67101183060272e7f7b1eaa92 @@ -180,26 +258,21 @@ jobs: docker: - image: cimg/base:stable steps: - - attach_workspace: - at: ~/package - - run: - name: "Unpack evmone" - background: true - command: tar xz < ~/package/evmone*.tar.gz + - unpack_package - run: name: "Download Aleth" background: true command: curl -L https://github.com/ethereum/aleth/releases/download/v$ALETH_REV/aleth-$ALETH_REV-linux-x86_64.tar.gz | tar xz + - download_consensus_tests: + rev: ac8cf2cd8ba326d67101183060272e7f7b1eaa92 - run: - name: "Download tests" + name: "Fixup consensus tests" command: | - mkdir tests && cd tests - curl -L https://github.com/ethereum/tests/archive/$TESTS_REV.tar.gz | tar -xz --strip=1 - mkdir GeneralStateTests/stEWASMTests - mkdir src/GeneralStateTestsFiller/stEWASMTests + mkdir -p ~/tests/GeneralStateTests/stEWASMTests + mkdir -p ~/tests/src/GeneralStateTestsFiller/stEWASMTests - run: name: "Run State Tests" - command: bin/testeth -t GeneralStateTests -- --testpath tests --vm lib/libevmone.so + command: bin/testeth -t GeneralStateTests -- --testpath ~/tests --vm ~/package/lib/libevmone.so gcc-min: @@ -306,6 +379,9 @@ workflows: ignore: /.*/ tags: only: /^v[0-9].*/ + - consensus-tests: + requires: + - release-linux - state-tests: requires: - release-linux