diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 61d920b70..8d1cfc041 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -10,10 +10,36 @@ on: # Allows you to run this workflow manually from the Actions tab #workflow_dispatch: +env: + SUITE_REPO: "NilFoundation/crypto3" + LIB_NAME: "zk" + CACHE_NAME: "checkout-job-cache" + jobs: checkout: runs-on: [self-hosted, tests-runner] steps: + - name: Cleanup # TODO - move to scripts on runner + run: | + rm -rf ./suite/* || true + mkdir ./suite || true + + - name: Checkout suite + uses: actions/checkout@v3 + with: + path: ./suite + repository: ${{ env.SUITE_REPO }} + submodules: recursive + + - name: Checkout source code + uses: actions/checkout@v3 + with: + path: ./suite/libs/${{ env.LIB_NAME }} + submodules: recursive + - name: Run CI script run: | - scripts/ci.sh + cd suite + cp libs/${{ env.LIB_NAME }}/scripts/build.sh . + libs/${{ env.LIB_NAME }}/scripts/ci.sh + diff --git a/scripts/ci.sh b/scripts/ci.sh index 65d685fd8..6991d60f0 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -2,13 +2,4 @@ set -vxe -rm -rf suite -mkdir -p suite && cd suite - -SUITE_REPO=https://github.com/NilFoundation/crypto3 - -git clone --depth=1 --recursive ${SUITE_REPO} - -pushd suite/crypto3/libs/zk -git switch ${GIT_BRANCH} -popd +echo "Scripted tests" diff --git a/scripts/docker/Dockerfile b/scripts/docker/Dockerfile new file mode 100644 index 000000000..2d9ee0b75 --- /dev/null +++ b/scripts/docker/Dockerfile @@ -0,0 +1,42 @@ +# Test environment for crypto3-zk + +FROM ubuntu:22.04 + +WORKDIR /home + +ENV DEBIAN_FRONTEND=noninteractive + +RUN useradd --system ${uid:+--uid "$uid"} --user-group --shell /sbin/nologin --create-home --home-dir /home test + +RUN apt-get update \ + && apt-get install -y --no-install-recommends --no-install-suggests \ + curl \ + gnupg \ + ca-certificates + +RUN apt-get update \ + && apt-get install -y --no-install-recommends --no-install-suggests \ + build-essential \ + cmake \ + git \ + clang-14 pkg-config libc-ares-dev liblz4-dev libgnutls28-dev \ + libprotobuf-dev libyaml-cpp-dev lksctp-tools libsctp-dev ragel \ + spd \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +RUN cd /tmp && curl -L -O https://launchpadlibrarian.net/466750967/libfmt-dev_6.1.2+ds-2_amd64.deb \ + && apt install /tmp/libfmt-dev_6.1.2+ds-2_amd64.deb + +#RUN cd /tmp && curl -L -O https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2 +RUN cd /tmp && curl -O http://192.168.123.11:8000/boost_1_76_0.tar.bz2 + +RUN cd /tmp && tar jxf boost_1_76_0.tar.bz2 \ + && cd boost_1_76_0 && ./bootstrap.sh && ./b2 install + +RUN cd /tmp && rm -rf boost* libfmt* + +RUN chown test:test /home + +USER test +