diff --git a/.github/workflows/rit.yml b/.github/workflows/rit.yml new file mode 100644 index 000000000..f461623c2 --- /dev/null +++ b/.github/workflows/rit.yml @@ -0,0 +1,51 @@ +name: Rootstock Integration Tests + +on: + push: + branches: ["master", "*-rc"] + pull_request: + types: [ opened, synchronize, reopened ] + branches: [ "master", "*-rc" ] + workflow_dispatch: + inputs: + rit-branch: + description: 'Branch for Rootstock Integration Tests' + required: false + default: 'main' + rskj-branch: + description: 'Branch for RSKJ repo' + required: false + default: 'master' + +jobs: + rootstock-integration-tests: + name: Rootstock Integration Tests + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - name: Set Branch Variables + id: set-branch-variables + run: | + # Default values + POWPEG_BRANCH="master" + RIT_BRANCH="${{ github.event.inputs.rit-branch || 'main' }}" + RSKJ_BRANCH="${{ github.event.inputs.rskj-branch || 'master' }}" + + if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/*-rc" ]]; then + POWPEG_BRANCH="${{ github.ref }}" + elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then + POWPEG_BRANCH="${{ github.ref_name }}" + elif [[ "${{ github.event_name }}" == "pull_request" ]]; then + POWPEG_BRANCH="${{ github.head_ref }}" + fi + + echo "RSKJ_BRANCH=$RSKJ_BRANCH" >> $GITHUB_ENV + echo "RIT_BRANCH=$RIT_BRANCH" >> $GITHUB_ENV + echo "POWPEG_BRANCH=$POWPEG_BRANCH" >> $GITHUB_ENV + + - name: Run Rootstock Integration Tests + uses: rsksmart/rootstock-integration-tests@497172fd38dcfaf48c77f9bb1eeb6617eef5eed6 #v1 + with: + rskj-branch: ${{ env.RSKJ_BRANCH }} + powpeg-node-branch: ${{ env.POWPEG_BRANCH }} + rit-branch: ${{ env. RIT_BRANCH }} \ No newline at end of file