Skip to content

feat:When the engine encounters an extremely large event, a warning i… #1959

feat:When the engine encounters an extremely large event, a warning i…

feat:When the engine encounters an extremely large event, a warning i… #1959

Workflow file for this run

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@v3
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:
runs-on: ubuntu-latest
needs:
- Get-Stable-Branch
steps:
- name: Checkout Tapdata Connectors Code
uses: actions/checkout@v3
with:
repository: 'tapdata/tapdata-connectors'
ref: ${{ needs.Get-Stable-Branch.outputs.CONNECTORS_BRANCH }}
token: ${{ secrets.TAPDATA_ENT_CICD_TOKEN }}
path: tapdata-connectors
fetch-depth: 0
- name: Checkout Tapdata Application
uses: actions/checkout@v2
with:
repository: 'tapdata/tapdata-application'
ref: main
token: ${{ secrets.TAPDATA_ENT_CICD_TOKEN }}
path: tapdata-application
fetch-depth: 0
- name: Push Tapdata Connectors to Gogs
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: |
bash tapdata-application/build/upgrade.sh --upgrade-code=true --upgrade-code-path=tapdata-connectors --gogs-project-name=tapdata-connectors
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@v2
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 }}