Skip to content

Commit

Permalink
Fixing inputs on the test step
Browse files Browse the repository at this point in the history
  • Loading branch information
fmacleal authored and marcos-iov committed Jul 31, 2024
1 parent b466a8e commit d92cd9c
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 28 deletions.
8 changes: 4 additions & 4 deletions .github/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
File renamed without changes.
24 changes: 17 additions & 7 deletions .github/images/entrypoint.sh → .github/image/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
#!/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

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/
Expand All @@ -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"
Expand Down
36 changes: 19 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d92cd9c

Please sign in to comment.