Adding Rootstock Integration Tests workflow #24
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rootstock Integration Tests | |
on: | |
push: | |
branches: | |
- "master" | |
- "*-rc" | |
pull_request: | |
types: [opened, reopened, synchronize] | |
branches: | |
- "**" | |
issue_comment: | |
types: | |
- created | |
- edited | |
jobs: | |
rootstock-integration-tests: | |
name: Rootstock Integration Tests | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- name: Checkout rskj Repository | |
if: github.event_name == 'pull_request' | |
uses: actions/checkout@v3 | |
with: | |
repository: rsksmart/rskj | |
ref: ${{ github.event.pull_request.head.ref }} | |
fetch-depth: 1 | |
- name: Get PR Description | |
if: github.event_name == 'pull_request' | |
id: get-pr-description | |
run: | | |
PR_NUMBER=${{ github.event.pull_request.number }} | |
PR_DESC=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
"https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER") | |
rskj_branch=$(echo "$PR_DESC" | jq -r '.body | select(test("rskj:")) | split(" ") | .[1]' || echo "master") | |
fed_branch=$(echo "$PR_DESC" | jq -r '.body | select(test("fed:")) | split(" ") | .[1]' || echo "master") | |
rit_branch=$(echo "$PR_DESC" | jq -r '.body | select(test("rit:")) | split(" ") | .[1]' || echo "main") | |
echo "RSKJ_BRANCH=$rskj_branch" >> $GITHUB_ENV | |
echo "FED_BRANCH=$fed_branch" >> $GITHUB_ENV | |
echo "RIT_BRANCH=$rit_branch" >> $GITHUB_ENV | |
- name: Checkout Rootstock Integration Tests Repository | |
uses: actions/checkout@v3 | |
with: | |
repository: rsksmart/rootstock-integration-tests | |
ref: ${{ env.RIT_BRANCH }} | |
fetch-depth: 1 | |
- name: Check Comment Condition | |
run: | | |
echo "Evaluating condition..." | |
if [[ "${{ github.event_name }}" == "issue_comment" && "${{ github.event.comment.body }}" == *"/pipeline:run"* ]]; then | |
echo "Condition met: Pipeline run command detected in comment." | |
else | |
echo "Condition not met: Comment body is '${{ github.event.comment.body }}'" | |
fi | |
- name: Run Rootstock Integration Tests | |
if: github.event_name == 'pull_request' || (github.event_name == 'issue_comment' && contains(github.event.comment.body, '/pipeline:run')) | |
uses: rsksmart/rootstock-integration-tests@v3 | |
with: | |
rskj-branch: ${{ env.RSKJ_BRANCH }} | |
powpeg-node-branch: ${{ env.FED_BRANCH }} | |
- name: Notify on Status | |
run: echo "Rootstock Integration Tests pipeline triggered" |