From ff9774da7f85acff9d3046a31aea3eb943aaa46c Mon Sep 17 00:00:00 2001 From: Zach Butler Date: Wed, 18 Jan 2023 01:31:39 -0500 Subject: [PATCH] Build and upload contract unit test(s) --- .github/workflows/build-contract-test.sh | 27 ++++++++++++++++++++++++ .github/workflows/contract.yml | 9 ++++++++ 2 files changed, 36 insertions(+) create mode 100755 .github/workflows/build-contract-test.sh diff --git a/.github/workflows/build-contract-test.sh b/.github/workflows/build-contract-test.sh new file mode 100755 index 00000000..f4112cef --- /dev/null +++ b/.github/workflows/build-contract-test.sh @@ -0,0 +1,27 @@ +#!/bin/bash +set -eo pipefail + +# print and run a command +function ee() +{ + echo "$ $*" + eval "$@" +} + +# debug code +ee nodeos --full-version +ee cmake --version + +# build +ee mkdir -p contract/tests/build +ee pushd contract/tests +ee pushd build +ee cmake .. +ee make -j "$(nproc)" unit_test + +# pack +ee popd +ee 'tar -czf ../../contract-unit-test.tar.gz build/*' +ee popd + +echo "Done! - ${0##*/}" diff --git a/.github/workflows/contract.yml b/.github/workflows/contract.yml index ea5d8a5f..4cac8660 100644 --- a/.github/workflows/contract.yml +++ b/.github/workflows/contract.yml @@ -48,3 +48,12 @@ jobs: - name: Install Leap run: sudo apt-get install -y ./leap*.deb + + - name: Build TrustEVM Contract Tests + run: .github/workflows/build-contract-test.sh + + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: contract-test.tar.gz + path: contract-test.tar.gz