Skip to content

Commit

Permalink
CI scripts update #238
Browse files Browse the repository at this point in the history
  • Loading branch information
vo-nil committed Nov 29, 2023
1 parent 6f9a321 commit 8aba1d8
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 11 deletions.
28 changes: 27 additions & 1 deletion .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 1 addition & 10 deletions scripts/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
42 changes: 42 additions & 0 deletions scripts/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8aba1d8

Please sign in to comment.