-
Notifications
You must be signed in to change notification settings - Fork 267
86 lines (77 loc) · 2.63 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Rootstock Integration Tests
on:
push:
branches:
- "master"
- "*-rc"
pull_request:
types: [opened, reopened, synchronize]
branches:
- "**"
workflow_dispatch:
inputs:
rit-branch:
description: 'Branch for Rootstock Integration Tests'
required: false
default: 'main'
powpeg-branch:
description: 'Branch for PowPeg Node'
required: false
default: 'master'
jobs:
rootstock-integration-tests:
name: Rootstock Integration Tests
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: write
packages: write
issues: read
pull-requests: write
actions: read
deployments: read
steps:
- name: Set Branch Variables
id: set-branch-variables
run: |
# Default values
RSKJ_BRANCH="unknown"
RIT_BRANCH="${{ github.event.inputs.rit-branch || 'main' }}"
POWPEG_BRANCH="${{ github.event.inputs.powpeg-branch || 'master' }}"
if [[ "${{ github.event_name }}" == "push" ]]; then
if [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
RSKJ_BRANCH="master"
elif [[ "${{ github.ref }}" =~ refs/heads/(.*)-rc ]]; then
RSKJ_BRANCH="${BASH_REMATCH[1]}-rc"
else
RSKJ_BRANCH="${{ github.head_ref || github.ref_name }}"
fi
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
RSKJ_BRANCH="${{ github.event.pull_request.head.ref }}"
fi
echo "RSKJ_BRANCH=$RSKJ_BRANCH" >> $GITHUB_ENV
echo "RIT_BRANCH=$RIT_BRANCH" >> $GITHUB_ENV
echo "POWPEG_BRANCH=$POWPEG_BRANCH" >> $GITHUB_ENV
echo "RSKJ_BRANCH=${{ env.RSKJ_BRANCH }}"
echo "RIT_BRANCH=${{ env.RIT_BRANCH }}"
echo "POWPEG_BRANCH=${{ env.POWPEG_BRANCH }}"
- name: Checkout rskj Repository
if: github.event_name == 'pull_request'
uses: actions/checkout@v3
with:
repository: rsksmart/rskj
ref: ${{ env.RSKJ_BRANCH }}
fetch-depth: 1
- name: Checkout Rootstock Integration Tests Repository
uses: actions/checkout@v4
with:
repository: rsksmart/rootstock-integration-tests
ref: ${{ env.RIT_BRANCH }}
fetch-depth: 0
- name: Run Rootstock Integration Tests
uses: rsksmart/rootstock-integration-tests@v1
with:
rskj-branch: ${{ env.RSKJ_BRANCH }}
powpeg-node-branch: ${{ env.POWPEG_BRANCH }}
- name: Notify on Status
run: echo "Rootstock Integration Tests pipeline triggered"