-
Notifications
You must be signed in to change notification settings - Fork 267
69 lines (62 loc) · 2.55 KB
/
rit.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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"