From e7b48572c34be6ae954e5d9f763bc46644353787 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 | 10 +++++----- .github/images/entrypoint.sh | 18 ++++++++++++++---- .github/workflows/ci.yml | 21 +++++++++++++-------- 3 files changed, 32 insertions(+), 17 deletions(-) diff --git a/.github/action.yml b/.github/action.yml index 37811e8e..d1d06954 100644 --- a/.github/action.yml +++ b/.github/action.yml @@ -29,8 +29,8 @@ outputs: 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 }} + args: + - ${{ inputs.rskj-branch }} + - ${{ inputs.powpeg-node-branch }} + - ${{ inputs.rit-branch }} + - ${{ inputs.rit-log-level }} \ No newline at end of file diff --git a/.github/images/entrypoint.sh b/.github/images/entrypoint.sh index 1c4216dd..86c10adc 100644 --- a/.github/images/entrypoint.sh +++ b/.github/images/entrypoint.sh @@ -1,11 +1,21 @@ #!/bin/bash set -e +RSKJ_BRANCH="${1:-INPUT_RSKJ-BRANCH}" +POWPEG_NODE_BRANCH="${2:-INPUT_POWPEG-NODE-BRANCH}" +RIT_BRANCH="${3:-INPUT_RIT-BRANCH}" +LOG_LEVEL="${4:-INPUT_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,7 +23,7 @@ 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" @@ -27,11 +37,11 @@ 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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 885cdb57..5e12860d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,15 +49,20 @@ jobs: - 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" \ + -v "$GITHUB_OUTPUT:/github-output" \ + --rm ${{ env.TEST_TAG }} \ + "${{ env.INPUT_RSKJ_BRANCH }}" \ + "${{ env.INPUT_POWPEG_NODE_BRANCH }}" \ + "${{ env.INPUT_RIT_BRANCH }}" \ + "${{ env.INPUT_RIT_LOG_LEVEL }}" - name: GitHub container registry login uses: docker/login-action@v3