Skip to content

Adding Rootstock Integration Tests workflow #11

Adding Rootstock Integration Tests workflow

Adding Rootstock Integration Tests workflow #11

Workflow file for this run

name: Rootstock Integration Tests
on:
pull_request:
branches:
- "master"
- "*-rc"
issue_comment:
types:
- created
- edited
jobs:
rootstock-integration-tests:
name: Rootstock Integration Tests
if: github.event.pull_request
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout rskj Repository
uses: actions/checkout@v3
with:
repository: rsksmart/rskj
ref: ${{ github.event.pull_request.head.ref }}
- name: Print GitHub Event Information
run: |
echo "GitHub Event Name: ${{ github.event_name }}"
echo "GitHub Event Action: ${{ github.event.action }}"
echo "GitHub Repository: ${{ github.repository }}"
echo "GitHub Ref: ${{ github.ref }}"
echo "GitHub PR Number: ${{ github.event.pull_request.number }}"
echo "GitHub Comment Body: ${{ github.event.comment.body }}"
- name: Get PR Description
id: get-pr-description
run: |
PR_NUMBER=${{ github.event.pull_request.number }}
echo "PR Number: $PR_NUMBER"
PR_DESC=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER")
echo "PR Description: $PR_DESC"
# Extract and print the branch names
rskj_branch=$(echo "$PR_DESC" | jq -r '.body | select(test("rskj:")) | split(" ") | .[1]')
fed_branch=$(echo "$PR_DESC" | jq -r '.body | select(test("fed:")) | split(" ") | .[1]')
rit_branch=$(echo "$PR_DESC" | jq -r '.body | select(test("rit:")) | split(" ") | .[1]')
echo "rskj_branch: $rskj_branch"
echo "fed_branch: $fed_branch"
echo "rit_branch: $rit_branch"
# Set environment variables for the next steps
echo "RSKJ_BRANCH=$rskj_branch" >> $GITHUB_ENV
echo "FED_BRANCH=$fed_branch" >> $GITHUB_ENV
echo "RIT_BRANCH=$rit_branch" >> $GITHUB_ENV
- name: Echo Environment Variables
run: |
echo "RSKJ_BRANCH=${{ env.RSKJ_BRANCH }}"
echo "FED_BRANCH=${{ env.FED_BRANCH }}"
echo "RIT_BRANCH=${{ env.RIT_BRANCH }}"
- name: Checkout Rootstock Integration Tests Repository
uses: actions/checkout@v3
with:
repository: rsksmart/rootstock-integration-tests
ref: ${{ env.RIT_BRANCH }}
- name: Run Rootstock Integration Tests
if: contains(github.event.comment.body, '/pipeline:run') || github.event.action == 'opened'
uses: rsksmart/rootstock-integration-tests@v1
with:
rskj-branch: ${{ env.RSKJ_BRANCH }}
powpeg-node-branch: ${{ env.FED_BRANCH }}
rit-branch: ${{ env.RIT_BRANCH }}
- name: Notify on Status
run: echo "Rootstock Integration Tests pipeline triggered"