From b9de331a1de2c64ec47767c4ccf226651b6b5b46 Mon Sep 17 00:00:00 2001 From: fmacleal Date: Wed, 26 Jun 2024 15:17:22 +0200 Subject: [PATCH] Adding results to the action outputs - In order to be able to validate results, we need to pass the test result to outputs from the Github configuration. This commit does it. --- .github/images/Dockerfile | 23 ----------------------- .github/images/entrypoint.sh | 14 ++++++++++++-- .github/workflows/ci.yml | 3 +-- 3 files changed, 13 insertions(+), 27 deletions(-) diff --git a/.github/images/Dockerfile b/.github/images/Dockerfile index e1beb09e..7a03bb98 100644 --- a/.github/images/Dockerfile +++ b/.github/images/Dockerfile @@ -32,29 +32,6 @@ ENV JAVA_HOME="/usr/lib/jvm/java-$JAVA_VERSION-openjdk-amd64" \ RUN export JAVA_HOME=$JAVA_HOME \ && export PATH="$JAVA_HOME:$PATH" -# -- python --------------------------------------------------------- -ENV PYTHON_VERSION=2.7.16 - -# Install dependencies -RUN apt-get update \ - && apt-get install -y gcc make openssl libffi-dev libgdbm-dev libsqlite3-dev libssl-dev zlib1g-dev \ - && apt-get clean - -RUN export PREVIOUS_PATH=$(pwd) \ - && cd /tmp - -#Build Python from source -RUN wget https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz \ - && tar --extract -f Python-$PYTHON_VERSION.tgz \ - && cd ./Python-$PYTHON_VERSION/ \ - && ./configure --with-ensurepip=install --enable-optimizations --prefix=/usr/local \ - && make && make install \ - && cd ../ \ - && rm -r ./Python-$PYTHON_VERSION* \ - && python --version \ - && pip --version \ - && cd $PREVIOUS_PATH - # -- bitcoind --------------------------------------------------------- ENV BITCOIN_VERSION 0.18.1 diff --git a/.github/images/entrypoint.sh b/.github/images/entrypoint.sh index a0a4c11e..81967359 100644 --- a/.github/images/entrypoint.sh +++ b/.github/images/entrypoint.sh @@ -36,6 +36,16 @@ export LOG_LEVEL=$RIT_LOG_LEVEL echo -e "\n\n--------- Executing Rootstock Integration Tests ---------\n\n" npm install -y npm run test-fail-fast +STATUS=$? -# Keep the container running -tail -f /dev/null +if [ $STATUS -ne 0 ]; then + echo -e "\n\n--------- RIT Tests failed ---------\n\n" + MESSAGE="Rootstock Integration Tests Result: FAILED" +else + echo -e "\n\n--------- RIT Tests passed ---------\n\n" + MESSAGE="Rootstock Integration Tests Result: PASSED" +fi + +# Write Results to the $GITHUB_OUTPUT file +echo "STATUS=$STATUS" >>"$GITHUB_OUTPUT" +echo "MESSAGE=$MESSAGE" >>"$GITHUB_OUTPUT" \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9fc0b521..ec4c23f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,8 +34,7 @@ jobs: with: install: true driver-opts: network=host - platforms: linux/amd64,linux/arm64 - + platforms: linux/amd64 - name: Build the RIT Container id: build