Merge pull request #746 from tapdata/harsen/fix-develop-upgradeGithub… #2065
This file contains hidden or 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
| name: Merge Request CI and Nightly Build | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| on: | ||
| push: | ||
| branches: [ "main", "develop", "release-v*.*" ] | ||
| pull_request: | ||
| branches: [ "main", "develop", "release-v*.*" ] | ||
| jobs: | ||
| Get-Current-Branch: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| branch: ${{ steps.get_branch.outputs.branch }} | ||
| steps: | ||
| - name: Get OpenSource Branch Name -- Common | ||
| run: | | ||
| echo "BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV | ||
| - name: Get OpenSource Branch Name -- Pr | ||
| if: github.event_name == 'pull_request' | ||
| run: | | ||
| echo "BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV | ||
| - name: Get Connectors Enterprise Branch Name -- Schedule | ||
| if: github.event_name == 'schedule' | ||
| run: | | ||
| echo "BRANCH=develop" >> $GITHUB_ENV | ||
| - name: output branch name | ||
| id: get_branch | ||
| run: | | ||
| echo "::set-output name=branch::${{ env.BRANCH }}" | ||
| Get-Stable-Branch: | ||
| runs-on: ubuntu-latest | ||
| needs: | ||
| - Get-Current-Branch | ||
| outputs: | ||
| OPENSOURCE_BRANCH: ${{ steps.set-output.outputs.OPENSOURCE_BRANCH }} | ||
| ENTERPRISE_BRANCH: ${{ steps.set-output.outputs.ENTERPRISE_BRANCH }} | ||
| FRONTEND_BRANCH: ${{ steps.set-output.outputs.FRONTEND_BRANCH }} | ||
| CONNECTORS_BRANCH: ${{ steps.set-output.outputs.CONNECTORS_BRANCH }} | ||
| TAG_NAME: ${{ steps.set-output.outputs.TAG_NAME }} | ||
| steps: | ||
| - name: Checkout Tapdata Opensource | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: 'tapdata/tapdata' | ||
| token: ${{ secrets.TAPDATA_ENT_CICD_TOKEN }} | ||
| ref: main | ||
| path: tapdata | ||
| fetch-depth: 0 | ||
| - name: Set Tag | ||
| run: | | ||
| cd tapdata | ||
| main_tag=$(git describe --tags | cut -d '-' -f 1) | ||
| current_timestamp=$(date +%s) | ||
| hex_timestamp=$(printf "%X" "$current_timestamp" | tr 'A-F' 'a-f') | ||
| tag_name="$main_tag-$hex_timestamp" | ||
| echo "TAG_NAME=$tag_name" >> $GITHUB_ENV | ||
| - name: Get last stable branch | ||
| id: set-output | ||
| run: | | ||
| OPENSOURCE_BRANCH=main | ||
| ENTERPRISE_BRANCH=main | ||
| CONNECTORS_BRANCH=${{ needs.Get-Current-Branch.outputs.branch }} | ||
| FRONTEND_BRANCH=main | ||
| echo "::set-output name=OPENSOURCE_BRANCH::${OPENSOURCE_BRANCH}" | ||
| echo "::set-output name=ENTERPRISE_BRANCH::${ENTERPRISE_BRANCH}" | ||
| echo "::set-output name=FRONTEND_BRANCH::${FRONTEND_BRANCH}" | ||
| echo "::set-output name=CONNECTORS_BRANCH::${CONNECTORS_BRANCH}" | ||
| echo "::set-output name=TAG_NAME::${TAG_NAME}" | ||
| Sync-Code-to-Office: | ||
| needs: Get-Stable-Branch | ||
| uses: tapdata/tapdata-application/.github/workflows/sync-code-to-office.yaml@main | ||
|
Check failure on line 77 in .github/workflows/mr-ci.yaml
|
||
| secrets: inherit | ||
| with: | ||
| tapdata-connectors: ${{ needs.Get-Current-Branch.outputs.branch }} | ||
| gitee-token-user: "${{ vars.GITEE_TOKEN_USER }}" | ||
| Scan-Connectors: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 50 | ||
| needs: | ||
| - Sync-Code-to-Office | ||
| - Get-Stable-Branch | ||
| steps: | ||
| - name: Scan -- Tapdata-Connectors | ||
| id: sonar | ||
| uses: convictional/trigger-workflow-and-wait@v1.6.1 | ||
| with: | ||
| owner: tapdata | ||
| repo: tapdata-application | ||
| github_token: ${{ secrets.TAPDATA_ENT_CICD_TOKEN }} | ||
| workflow_file_name: sonarqube-scan.yaml | ||
| ref: main | ||
| wait_interval: 10 | ||
| client_payload: '{"tapdata-connectors": "${{ needs.Get-Stable-Branch.outputs.CONNECTORS_BRANCH }}"}' | ||
| propagate_failure: true | ||
| trigger_workflow: true | ||
| wait_workflow: true | ||
| - name: Checkout Tapdata-Application | ||
| if: ${{ always() && steps.sonar.outcome == 'failure' }} | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: 'tapdata/tapdata-application' | ||
| ref: "main" | ||
| token: ${{ secrets.TAPDATA_ENT_CICD_TOKEN }} | ||
| path: tapdata-application | ||
| - name: Send SonarQube Quality Gate to Pr Comment | ||
| if: ${{ always() && steps.sonar.outcome == 'failure' }} | ||
| run: | | ||
| cd tapdata-application/build/ && bash check_sonarqube.sh --project-key=tapdata-connectors --branch=${{ needs.Get-Stable-Branch.outputs.CONNECTORS_BRANCH }} \ | ||
| --sonar-token=${{ secrets.SONAR_TOKEN }} --github-token=${{ secrets.TAPDATA_ENT_CICD_TOKEN }} \ | ||
| --repo=tapdata-connectors --pr-number=${{ github.event.pull_request.number }} | ||