From d92cd9cb3d49dee338367b7919c058f0440c52af Mon Sep 17 00:00:00 2001 From: fmacleal Date: Thu, 18 Jul 2024 17:06:02 +0200 Subject: [PATCH] Fixing inputs on the test step --- .github/action.yml | 8 ++--- .github/{images => image}/Dockerfile | 0 .github/{images => image}/entrypoint.sh | 24 +++++++++---- .../logbacks/logback-fed-1.xml | 0 .../logbacks/logback-fed-2.xml | 0 .../logbacks/logback-fed-3.xml | 0 .../logbacks/logback-fed-4.xml | 0 .../logbacks/logback-fed-5.xml | 0 .../rit-local-configs/regtest-all-keys.js | 0 .../scripts/configure_gradle_powpeg.sh | 0 .../scripts/configure_rit_locally.sh | 0 .github/workflows/ci.yml | 36 ++++++++++--------- 12 files changed, 40 insertions(+), 28 deletions(-) rename .github/{images => image}/Dockerfile (100%) rename .github/{images => image}/entrypoint.sh (70%) rename .github/{images => image}/rit-local-configs/logbacks/logback-fed-1.xml (100%) rename .github/{images => image}/rit-local-configs/logbacks/logback-fed-2.xml (100%) rename .github/{images => image}/rit-local-configs/logbacks/logback-fed-3.xml (100%) rename .github/{images => image}/rit-local-configs/logbacks/logback-fed-4.xml (100%) rename .github/{images => image}/rit-local-configs/logbacks/logback-fed-5.xml (100%) rename .github/{images => image}/rit-local-configs/regtest-all-keys.js (100%) rename .github/{images => image}/scripts/configure_gradle_powpeg.sh (100%) rename .github/{images => image}/scripts/configure_rit_locally.sh (100%) diff --git a/.github/action.yml b/.github/action.yml index 37811e8e..298ca755 100644 --- a/.github/action.yml +++ b/.github/action.yml @@ -30,7 +30,7 @@ runs: using: docker image: ./images/Dockerfile env: - RSKJ_BRANCH: ${{ inputs.rskj-branch }} - POWPEG_NODE_BRANCH: ${{ inputs.powpeg-node-branch }} - RIT_BRANCH: ${{ inputs.rit-branch }} - RIT_LOG_LEVEL: ${{ inputs.rit-log-level }} + INPUT_RSKJ_BRANCH: ${{ inputs.rskj-branch }} + INPUT_POWPEG_NODE_BRANCH: ${{ inputs.powpeg-node-branch }} + INPUT_RIT_BRANCH: ${{ inputs.rit-branch }} + INPUT_RIT_LOG_LEVEL: ${{ inputs.rit-log-level }} diff --git a/.github/images/Dockerfile b/.github/image/Dockerfile similarity index 100% rename from .github/images/Dockerfile rename to .github/image/Dockerfile diff --git a/.github/images/entrypoint.sh b/.github/image/entrypoint.sh similarity index 70% rename from .github/images/entrypoint.sh rename to .github/image/entrypoint.sh index 1c4216dd..b9a1c551 100644 --- a/.github/images/entrypoint.sh +++ b/.github/image/entrypoint.sh @@ -1,11 +1,21 @@ -#!/bin/bash +#!/bin/sh -l set -e +RSKJ_BRANCH="${INPUT_RSKJ_BRANCH}" +POWPEG_NODE_BRANCH="${INPUT_POWPEG_NODE_BRANCH}" +RIT_BRANCH="${INPUT_RIT_BRANCH}" +LOG_LEVEL="${INPUT_RIT_LOG_LEVEL}" + +echo -e "\n\n--------- Input parameters received ---------\n\n" +echo "RSKJ_BRANCH=$RSKJ_BRANCH" +echo "POWPEG_NODE_BRANCH=$POWPEG_NODE_BRANCH" +echo "RIT_BRANCH=$RIT_BRANCH" +echo "LOG_LEVEL=$LOG_LEVEL" echo -e "\n\n--------- Starting the configuration of rskj ---------\n\n" cd /usr/src/ git clone https://github.com/rsksmart/rskj.git rskj -cd rskj && git checkout "${INPUT_RSKJ_BRANCH}" +cd rskj && git checkout "$RSKJ_BRANCH" chmod +x ./configure.sh && chmod +x gradlew ./configure.sh @@ -13,12 +23,12 @@ echo -e "\n\n--------- Starting the configuration of powpeg ---------\n\n" cd /usr/src/ git clone https://github.com/rsksmart/powpeg-node.git powpeg cp configure_gradle_powpeg.sh powpeg -cd powpeg && git checkout "${INPUT_POWPEG_NODE_BRANCH}" +cd powpeg && git checkout "$POWPEG_NODE_BRANCH" chmod +x ./configure.sh && chmod +x gradlew POWPEG_VERSION=$(bash configure_gradle_powpeg.sh) echo "POWPEG_VERSION=$POWPEG_VERSION" ./configure.sh -./gradlew --info --no-daemon clean build -x test +#./gradlew --info --no-daemon clean build -x test echo -e "\n\n--------- Starting the configuration of RIT ---------\n\n" cd /usr/src/ @@ -27,15 +37,15 @@ mv configure_rit_locally.sh rit mv regtest.js rit/config/regtest.js mv /usr/src/logbacks/* /usr/src/rit/logbacks/ cd rit -git checkout "${INPUT_RIT_BRANCH}" +git checkout "$RIT_BRANCH" chmod +x ./configure.sh ./configure.sh ./configure_rit_locally.sh "${POWPEG_VERSION}" -export LOG_LEVEL="${INPUT_RIT_LOG_LEVEL}" +export LOG_LEVEL="$LOG_LEVEL" echo -e "\n\n--------- Executing Rootstock Integration Tests ---------\n\n" npm install -y -npm run test-fail-fast +#npm run test-fail-fast STATUS=$? echo -e "\n\n--------- RIT Tests Result ---------\n\n" diff --git a/.github/images/rit-local-configs/logbacks/logback-fed-1.xml b/.github/image/rit-local-configs/logbacks/logback-fed-1.xml similarity index 100% rename from .github/images/rit-local-configs/logbacks/logback-fed-1.xml rename to .github/image/rit-local-configs/logbacks/logback-fed-1.xml diff --git a/.github/images/rit-local-configs/logbacks/logback-fed-2.xml b/.github/image/rit-local-configs/logbacks/logback-fed-2.xml similarity index 100% rename from .github/images/rit-local-configs/logbacks/logback-fed-2.xml rename to .github/image/rit-local-configs/logbacks/logback-fed-2.xml diff --git a/.github/images/rit-local-configs/logbacks/logback-fed-3.xml b/.github/image/rit-local-configs/logbacks/logback-fed-3.xml similarity index 100% rename from .github/images/rit-local-configs/logbacks/logback-fed-3.xml rename to .github/image/rit-local-configs/logbacks/logback-fed-3.xml diff --git a/.github/images/rit-local-configs/logbacks/logback-fed-4.xml b/.github/image/rit-local-configs/logbacks/logback-fed-4.xml similarity index 100% rename from .github/images/rit-local-configs/logbacks/logback-fed-4.xml rename to .github/image/rit-local-configs/logbacks/logback-fed-4.xml diff --git a/.github/images/rit-local-configs/logbacks/logback-fed-5.xml b/.github/image/rit-local-configs/logbacks/logback-fed-5.xml similarity index 100% rename from .github/images/rit-local-configs/logbacks/logback-fed-5.xml rename to .github/image/rit-local-configs/logbacks/logback-fed-5.xml diff --git a/.github/images/rit-local-configs/regtest-all-keys.js b/.github/image/rit-local-configs/regtest-all-keys.js similarity index 100% rename from .github/images/rit-local-configs/regtest-all-keys.js rename to .github/image/rit-local-configs/regtest-all-keys.js diff --git a/.github/images/scripts/configure_gradle_powpeg.sh b/.github/image/scripts/configure_gradle_powpeg.sh similarity index 100% rename from .github/images/scripts/configure_gradle_powpeg.sh rename to .github/image/scripts/configure_gradle_powpeg.sh diff --git a/.github/images/scripts/configure_rit_locally.sh b/.github/image/scripts/configure_rit_locally.sh similarity index 100% rename from .github/images/scripts/configure_rit_locally.sh rename to .github/image/scripts/configure_rit_locally.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 885cdb57..494627d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,21 +43,26 @@ jobs: - name: Build and export locally Docker uses: docker/build-push-action@v6 with: - context: .github/images + context: .github/image load: true tags: ${{ env.TEST_TAG }} - name: Test the RIT Container Action id: test-container + env: + INPUT_RSKJ_BRANCH: master + INPUT_POWPEG_NODE_BRANCH: master + INPUT_RIT_BRANCH: main + INPUT_RIT_LOG_LEVEL: info run: | - docker run \ - --env INPUT_RSKJ_BRANCH="master" \ - --env INPUT_POWPEG_NODE_BRANCH="master" \ - --env INPUT_RIT_BRANCH="main" \ - --env INPUT_RIT_LOG_LEVEL="info" \ - --env GITHUB_OUTPUT="/github-output" \ - -v "$GITHUB_OUTPUT:/github-output" \ - --rm ${{ env.TEST_TAG }} + docker run \ + --env GITHUB_OUTPUT="/github-output" \ + --env INPUT_RSKJ_BRANCH="${{ env.INPUT_RSKJ_BRANCH }}" \ + --env INPUT_POWPEG_NODE_BRANCH="${{ env.INPUT_POWPEG_NODE_BRANCH }}" \ + --env INPUT_RIT_BRANCH="${{ env.INPUT_RIT_BRANCH }}" \ + --env INPUT_RIT_LOG_LEVEL="${{ env.INPUT_RIT_LOG_LEVEL }}" \ + -v "$GITHUB_OUTPUT:/github-output" \ + --rm ${{ env.TEST_TAG }} - name: GitHub container registry login uses: docker/login-action@v3 @@ -69,7 +74,7 @@ jobs: - name: Build the RIT Action Container Image uses: docker/build-push-action@v6 with: - context: .github/images + context: .github/image tags: ${{ env.LATEST_TAG }} labels: ${{ steps.meta.outputs.labels }} load: true @@ -82,16 +87,13 @@ jobs: timeout-minutes: 60 steps: - - name: GitHub container registry login - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} + - name: Checkout + id: checkout + uses: actions/checkout@v4 - name: Test RIT Action id: test-rit-action - uses: docker://ghcr.io/rsksmart/rootstock-integration-tests/rit:latest + uses: .github/ with: rskj-branch: master powpeg-node-branch: master