-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Rootstock Integration Tests workflow
- Loading branch information
1 parent
01bb758
commit 49b5e75
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Rootstock Integration Tests | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
branches: | ||
- "master" | ||
- "*-rc" | ||
issue_comment: | ||
types: | ||
- created | ||
- edited | ||
|
||
jobs: | ||
rootstock-integration-tests: | ||
name: Rootstock Integration Tests | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
steps: | ||
- name: Check out the code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Ensure the full history is fetched to checkout any branch | ||
|
||
- name: Get PR Description | ||
id: get-pr | ||
if: github.event_name == 'pull_request' | ||
run: | | ||
PR_DESC=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}" \ | ||
| jq -r '.body') | ||
echo "PR_DESC=$PR_DESC" >> $GITHUB_ENV | ||
- name: Parse Branches from PR Description | ||
id: parse-branches | ||
if: github.event_name == 'pull_request' | ||
run: | | ||
rskj_branch=$(echo "$PR_DESC" | grep -oP 'rskj:\K\w+') | ||
powpeg_node_branch=$(echo "$PR_DESC" | grep -oP 'powpeg-node:\K\w+') | ||
echo "rskj-branch=$rskj_branch" >> $GITHUB_ENV | ||
echo "powpeg-node-branch=$powpeg_node_branch" >> $GITHUB_ENV | ||
- name: Checkout RSKj branch | ||
id: checkout-rskj | ||
run: | | ||
git checkout ${{ env.rskj-branch }} | ||
continue-on-error: true | ||
|
||
- name: Checkout PowPeg branch | ||
id: checkout-powpeg | ||
run: | | ||
git clone --branch ${{ env.powpeg-node-branch }} https://github.com/rsksmart/powpeg.git | ||
continue-on-error: true | ||
|
||
- name: Test execution | ||
if: | | ||
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '/pipeline:run')) || | ||
(github.event_name == 'pull_request') | ||
uses: rsksmart/rootstock-integration-tests@v1 | ||
with: | ||
rskj-branch: ${{ env.rskj-branch || 'master' }} | ||
powpeg-node-branch: ${{ env.powpeg-node-branch || 'master' }} | ||
|