|
1 | 1 | name: Pull request approve workflow |
| 2 | +run-name: 'Pull request approve workflow ${{ github.event.pull_request.head.ref }} -> ${{ github.event.pull_request.base.ref }} by @${{ github.actor }}' |
2 | 3 |
|
3 | 4 | on: |
4 | 5 | pull_request_review: |
5 | | - types: [submitted] |
| 6 | + types: [ submitted ] |
6 | 7 |
|
7 | 8 | jobs: |
8 | | - build: |
9 | | - uses: opencb/java-common-libs/.github/workflows/build-java-app-workflow.yml@develop |
10 | | - with: |
11 | | - maven_opts: -Phdp3.1,RClient -Dopencga.war.name=opencga -Dcheckstyle.skip |
| 9 | + calculate-xetabase-branch: |
| 10 | + name: Calculate Xetabase branch |
| 11 | + runs-on: ubuntu-22.04 |
| 12 | + outputs: |
| 13 | + xetabase_branch: ${{ steps.get_xetabase_branch.outputs.xetabase_branch }} |
| 14 | + steps: |
| 15 | + - name: Clone project |
| 16 | + uses: actions/checkout@v4 |
| 17 | + with: |
| 18 | + fetch-depth: '10' |
| 19 | + ## This is important to avoid the error in the next step: "fatal: repository 'https://github.com/zetta-genomics/opencga-enterprise.git/' not found" |
| 20 | + persist-credentials: false |
| 21 | + - id: get_xetabase_branch |
| 22 | + name: "Get current branch for Xetabase from target branch" |
| 23 | + run: | |
| 24 | + chmod +x ./.github/workflows/scripts/get-xetabase-branch.sh |
| 25 | + echo "github.event.pull_request.base.ref: ${{ github.event.pull_request.base.ref }}" |
| 26 | + echo "github.event.pull_request.head.ref: ${{ github.event.pull_request.head.ref }}" |
| 27 | + xetabase_branch=$(./.github/workflows/scripts/get-xetabase-branch.sh ${{ github.event.pull_request.base.ref }}) |
| 28 | + echo "__Xetabase ref:__ \"${xetabase_branch}\"" | tee -a ${GITHUB_STEP_SUMMARY} |
| 29 | + echo "xetabase_branch=${xetabase_branch}" >> $GITHUB_OUTPUT |
| 30 | + env: |
| 31 | + ZETTA_REPO_ACCESS_TOKEN: ${{ secrets.ZETTA_REPO_ACCESS_TOKEN }} |
12 | 32 |
|
13 | 33 | test: |
14 | | - name: "Run all tests before merging, ie. short, medium and long tests." |
15 | | - uses: ./.github/workflows/test-analysis.yml |
16 | | - needs: build |
| 34 | + name: "Run all tests before merging" |
| 35 | + needs: calculate-xetabase-branch |
| 36 | + uses: opencb/java-common-libs/.github/workflows/test-xetabase-workflow.yml@develop |
17 | 37 | with: |
18 | | - test_profile: runShortTests,runMediumTests |
| 38 | + branch: ${{ needs.calculate-xetabase-branch.outputs.xetabase_branch }} |
| 39 | + task: ${{ github.event.pull_request.head.ref }} |
19 | 40 | secrets: inherit |
| 41 | + |
0 commit comments