[Enhancement] support tablet internal parallel merging for load spill blocks #60308
Workflow file for this run
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: CI PIPELINE | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.event.number }} | |
| cancel-in-progress: true | |
| permissions: | |
| issues: write | |
| checks: write | |
| jobs: | |
| basic-checker: | |
| runs-on: [self-hosted, normal] | |
| name: RUN CHECKER | |
| env: | |
| PR_NUMBER: ${{ github.event.number }} | |
| CODE_PATH: ${{ github.workspace }} | |
| BRANCH: ${{ github.base_ref }} | |
| GH_TOKEN: ${{ github.token }} | |
| outputs: | |
| PASS: ${{ steps.check.outputs.pass }} | |
| TEST_PR: ${{ steps.check_test_case.outputs.TEST_PR }} | |
| PRE_COMMIT: ${{ steps.check_blacklist.outputs.pre_commit }} | |
| PRE_COMMIT_CONCLUSION: ${{ steps.check_blacklist.outputs.pre_commit_conclusion }} | |
| PRE_COMMIT_JOB_STATUS_DICT: ${{ steps.check_blacklist.outputs.pre_commit_job_status_dict }} | |
| ONLY_BE_TEST: ${{ steps.check_blacklist.outputs.ONLY_BE_TEST }} | |
| ONLY_FE_TEST: ${{ steps.check_blacklist.outputs.ONLY_FE_TEST }} | |
| BE_CHANGE: ${{ steps.check_blacklist.outputs.BE_CHANGE }} | |
| FE_CHANGE: ${{ steps.check_blacklist.outputs.FE_CHANGE }} | |
| steps: | |
| - name: Sync Check | |
| id: check | |
| if: > | |
| (!contains(github.event.pull_request.title, '(sync #') && | |
| !contains(github.event.pull_request.labels.*.name, 'sync') && | |
| (!startsWith(github.head_ref, github.base_ref) || !contains(github.head_ref, '-sync-'))) || | |
| contains(github.event.pull_request.labels.*.name, 'force-check') | |
| run: | | |
| echo "pass=true" >> $GITHUB_OUTPUT | |
| - name: Upload info | |
| id: upload_info | |
| run: | | |
| echo $PR_NUMBER > pr_num.txt | |
| SHA=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.head.sha) | |
| echo "SHA=${SHA}" >> $GITHUB_OUTPUT | |
| - name: Upload the PR number | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pr_num | |
| path: ./pr_num.txt | |
| retention-days: 7 | |
| overwrite: true | |
| - name: Check Basic Workflow Status | |
| id: check_basic | |
| if: steps.check.outputs.pass == 'true' | |
| env: | |
| SHA: ${{ steps.upload_info.outputs.SHA }} | |
| run: | | |
| round_limit=10 | |
| while [[ $round_limit -gt 0 ]] | |
| do | |
| pr_check_run_info=$(gh run list -R ${{ github.repository }} -c ${SHA} --json status,name,startedAt,conclusion | jq '[.[] | select(.name == "PR CHECKER")] | sort_by(.startedAt)| last') | |
| if [[ "$pr_check_run_info" != 'null' ]] && [[ $(echo "$pr_check_run_info" | jq -r .status) == 'completed' ]]; then | |
| status=$(echo "$pr_check_run_info" | jq -r .conclusion) | |
| if [[ "$status" == 'success' ]]; then | |
| exit 0 | |
| else | |
| echo "::warning::The latest PR CHECKER status: ${status}!" | |
| fi | |
| fi | |
| round_limit=$((round_limit-1)) | |
| sleep 30 | |
| done | |
| echo "::error::PR CHECKER is timeout, please check and then you can re-execute by commenting on rerun!" | |
| exit 1 | |
| - name: Check Blacklist | |
| id: check_blacklist | |
| env: | |
| NO_SYNC: ${{ steps.check.outputs.pass }} | |
| AUTHOR: ${{ github.event.pull_request.user.login }} | |
| run: | | |
| rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull >/dev/null | |
| ./scripts/check-blacklist.sh | |
| - name: Check Test Case | |
| id: check_test_case | |
| if: steps.check.outputs.pass == 'true' | |
| env: | |
| AUTHOR: ${{ github.event.pull_request.user.login }} | |
| SHA: ${{ steps.upload_info.outputs.SHA }} | |
| run: | | |
| cd ci-tool | |
| ./scripts/check-testcase.sh | |
| - name: Check Feature Issue | |
| id: check_issue | |
| run: | | |
| cd ci-tool | |
| python3 scripts/get_pr_issue.py check_issue ${GITHUB_REPOSITORY} ${PR_NUMBER} | |
| - name: Get Title | |
| id: get_title | |
| run: | | |
| PR_TITLE=$(gh pr view ${PR_NUMBER} -R ${GITHUB_REPOSITORY} --json title -q '.title') | |
| echo "PR_TITLE<<EOF" >> $GITHUB_OUTPUT | |
| echo "${PR_TITLE}" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Check Title Format | |
| id: check_title_format | |
| env: | |
| PR_TITLE: ${{ steps.get_title.outputs.PR_TITLE }} | |
| run: | | |
| case "${{ env.PR_TITLE }}" in | |
| '[BugFix]'* | '[Enhancement]'* | '[Feature]'* | '[UT]'* | '[Doc]'* | '[Tool]'* | '[Refactor]'* | 'Revert'*) | |
| exit 0 | |
| ;; | |
| *) | |
| echo "::error::Title format is incorrect, please check!" | |
| exit 1 | |
| ;; | |
| esac | |
| - name: Checkout code | |
| id: checkout_code | |
| if: github.base_ref != 'main' | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: refs/pull/${{ github.event.pull_request.number }}/head | |
| - name: Checkout PR | |
| id: checkout_pr | |
| if: steps.checkout_code.outcome == 'success' | |
| run: | | |
| git remote add upstream https://github.com/${{ github.event.pull_request.base.repo.full_name }}.git | |
| git fetch upstream | |
| git merge upstream/${{ github.event.pull_request.base.ref }} --no-edit | |
| - name: Branch Access Check | |
| id: branch_access_check | |
| if: steps.checkout_pr.outcome =='success' | |
| env: | |
| PR_TITLE: ${{ steps.get_title.outputs.PR_TITLE }} | |
| run: | | |
| status=$(cat .github/.status || echo open) | |
| if [[ "${PR_TITLE}" == *"[Tool]"* ]]; then | |
| exit 0 | |
| elif [[ "${status}" == "feature-freeze" && "${PR_TITLE}" == *"[Feature]"* ]]; then | |
| comment="⚠️ Branch in feature-freeze state, [Feature] PRs are not allowed!" | |
| elif [[ "${status}" == "bugfix-only" ]] && [[ "${PR_TITLE}" == *"[Feature]"* || "${PR_TITLE}" == *"[Enhancement]"* ]]; then | |
| comment="⚠️ Branch in bugfix-only state, [Feature] or [Enhancement] PRs are not allowed!" | |
| elif [[ "${status}" == "code-freeze" ]] && [[ "${PR_TITLE}" != *"[Bugfix]"* || "${PR_TITLE}" != *"CVE"* ]]; then | |
| comment="⚠️ Branch in code-freeze state, only PRs that fix CVE are allowed!" | |
| else | |
| exit 0 | |
| fi | |
| echo "check_res=false" >> $GITHUB_OUTPUT | |
| echo "comment=${comment}" >> $GITHUB_OUTPUT | |
| - name: Check Approve | |
| if: steps.branch_access_check.outputs.check_res == 'false' | |
| env: | |
| REPO: ${{ github.repository }} | |
| TEAM: feature-reviewer | |
| PRE_COMMENT: ${{ steps.branch_access_check.outputs.comment }} | |
| run: | | |
| cd ci-tool | |
| ./scripts/check-approve.sh | |
| - name: Check Test Case Info | |
| if: always() && steps.check_test_case.outcome == 'success' && steps.check_test_case.outputs.TEST_PR != '' | |
| id: check_test_case_info | |
| run: | | |
| echo "TEST_PR=${{ steps.check_test_case.outputs.TEST_PR }}" >> ./test-pr-info.txt | |
| - name: Upload the Test Case Info | |
| uses: actions/upload-artifact@v4 | |
| if: steps.check_test_case_info.outcome == 'success' | |
| with: | |
| name: TEST_PR_INFO | |
| path: ./test-pr-info.txt | |
| retention-days: 7 | |
| overwrite: true | |
| be-checker: | |
| runs-on: ubuntu-latest | |
| needs: basic-checker | |
| name: BE FILTER | |
| if: needs.basic-checker.outputs.PASS == 'true' | |
| env: | |
| PRE_COMMIT: ${{ needs.basic-checker.outputs.PRE_COMMIT }} | |
| PRE_COMMIT_CONCLUSION: ${{ needs.basic-checker.outputs.PRE_COMMIT_CONCLUSION }} | |
| PRE_COMMIT_JOB_STATUS_DICT: ${{ needs.basic-checker.outputs.PRE_COMMIT_JOB_STATUS_DICT }} | |
| outputs: | |
| src_filter: ${{ steps.path-filter.outputs.be }} | |
| test_filter: ${{ steps.path-filter.outputs.ut }} | |
| thirdparty_filter: ${{ steps.path-filter.outputs.thirdparty }} | |
| only_test: ${{ needs.basic-checker.outputs.ONLY_BE_TEST }} | |
| pre_commit: ${{ needs.basic-checker.outputs.PRE_COMMIT }} | |
| pre_commit_conclusion: ${{ needs.basic-checker.outputs.PRE_COMMIT_CONCLUSION }} | |
| pre_commit_job_status_dict: ${{ needs.basic-checker.outputs.PRE_COMMIT_JOB_STATUS_DICT }} | |
| pre_ut_conclusion: ${{ steps.check_pre_commit_conclusion.outputs.pre_ut_conclusion }} | |
| pre_clang_conclusion: ${{ steps.check_pre_commit_conclusion.outputs.pre_clang_conclusion }} | |
| pre_thirdparty_conclusion: ${{ steps.check_pre_commit_conclusion.outputs.pre_thirdparty_conclusion }} | |
| pre_format_conclusion: ${{ steps.check_pre_commit_conclusion.outputs.pre_format_conclusion }} | |
| be_change: ${{ needs.basic-checker.outputs.BE_CHANGE }} | |
| steps: | |
| - uses: dorny/paths-filter@v3 | |
| id: path-filter | |
| with: | |
| filters: | | |
| be: | |
| - 'be/!(test)**' | |
| - 'gensrc/**' | |
| - 'build.sh' | |
| - 'thirdparty/**' | |
| - 'docker/dockerfiles/dev-env/dev-env.Dockerfile' | |
| ut: | |
| - 'be/test/**' | |
| - 'run-be-ut.sh' | |
| thirdparty: | |
| - 'thirdparty/**' | |
| - 'docker/dockerfiles/dev-env/dev-env.Dockerfile' | |
| - name: Prepare info | |
| run: | | |
| mkdir be-path-filter && cd be-path-filter | |
| echo ${{ steps.path-filter.outputs.be }} > src_filter.txt | |
| echo ${{ steps.path-filter.outputs.ut }} > test_filter.txt | |
| echo ${{ steps.path-filter.outputs.thirdparty }} > thirdparty_filter.txt | |
| - name: Upload the BE Filter Info | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: be-path-filter | |
| path: ./be-path-filter/ | |
| retention-days: 7 | |
| overwrite: true | |
| - name: check pre-commit conclusion | |
| id: check_pre_commit_conclusion | |
| if: (steps.path-filter.outputs.be == 'true' || steps.path-filter.outputs.ut == 'true') && needs.basic-checker.outputs.ONLY_BE_TEST == 'true' && env.PRE_COMMIT != '' && env.PRE_COMMIT_JOB_STATUS_DICT != '' | |
| run: | | |
| pre_commit_job_status_dict='${{ env.PRE_COMMIT_JOB_STATUS_DICT }}' | |
| pre_ut_conclusion=$(echo $pre_commit_job_status_dict | jq -r '."BE UT"') | |
| pre_clang_conclusion=$(echo $pre_commit_job_status_dict | jq -r '."Clang-Tidy"') | |
| pre_format_conclusion=$(echo $pre_commit_job_status_dict | jq -r '."Clang-Format"') | |
| pre_thirdparty_conclusion=$(echo $pre_commit_job_status_dict | jq -r '."Thirdparty Info"') | |
| echo "pre_ut_conclusion=${pre_ut_conclusion}" >> $GITHUB_OUTPUT | |
| echo "pre_clang_conclusion=${pre_clang_conclusion}" >> $GITHUB_OUTPUT | |
| echo "pre_thirdparty_conclusion=${pre_thirdparty_conclusion}" >> $GITHUB_OUTPUT | |
| echo "pre_format_conclusion=${pre_format_conclusion}" >> $GITHUB_OUTPUT | |
| clang-format: | |
| runs-on: [self-hosted, light] | |
| needs: be-checker | |
| name: Clang-Format | |
| env: | |
| PR_NUMBER: ${{ github.event.number }} | |
| outputs: | |
| pre_commit: ${{ needs.be-checker.outputs.pre_commit }} | |
| pre_commit_conclusion: ${{ needs.be-checker.outputs.pre_commit_conclusion }} | |
| pre_ut_conclusion: ${{ needs.be-checker.outputs.pre_ut_conclusion }} | |
| pre_clang_conclusion: ${{ needs.be-checker.outputs.pre_clang_conclusion }} | |
| pre_thirdparty_conclusion: ${{ needs.be-checker.outputs.pre_thirdparty_conclusion }} | |
| pre_format_conclusion: ${{ needs.be-checker.outputs.pre_format_conclusion }} | |
| be_change: ${{ needs.be-checker.outputs.be_change }} | |
| only_test: ${{ needs.be-checker.outputs.only_test }} | |
| if: needs.be-checker.outputs.src_filter == 'true' || needs.be-checker.outputs.test_filter == 'true' | |
| steps: | |
| - name: clean | |
| run: | | |
| rm -rf ${{ github.workspace }} | |
| mkdir -p ${{ github.workspace }} | |
| - name: Checkout Code | |
| id: checkout_code | |
| if: needs.be-checker.outputs.be_change == 'true' || needs.be-checker.outputs.pre_format_conclusion != 'success' | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: BRANCH INFO | |
| id: branch | |
| if: steps.checkout_code.outcome == 'success' | |
| run: | | |
| echo ${{github.base_ref}} | |
| echo "branch=${{github.base_ref}}" >> $GITHUB_OUTPUT | |
| - name: Checkout PR | |
| id: checkout_pr | |
| if: steps.checkout_code.outcome == 'success' | |
| run: | | |
| BRANCH=${{steps.branch.outputs.branch}} | |
| git config --global user.name "wanpengfei-git"; | |
| git config --global user.email "wanpengfei91@163.com"; | |
| git checkout $BRANCH; | |
| git pull; | |
| BRANCH_NAME="${BRANCH}-${PR_NUMBER}"; | |
| git fetch origin pull/${PR_NUMBER}/head:${BRANCH_NAME}; | |
| git checkout $BRANCH_NAME; | |
| git checkout -b merge_pr; | |
| git merge --squash --no-edit ${BRANCH} || (echo "::error::Merge conflict, please check." && exit -1); | |
| - name: Run Clang-Format | |
| id: run_clang_format | |
| if: steps.checkout_pr.outcome == 'success' | |
| run: | | |
| export PATH=/var/lib/llvm/bin:$PATH | |
| bash build-support/check-format.sh | |
| - name: Clean ENV | |
| if: always() | |
| run: | | |
| rm -rf ${{ github.workspace }}/* | |
| thirdparty-update: | |
| runs-on: [self-hosted, normal] | |
| needs: [clang-format] | |
| name: Thirdparty Update | |
| continue-on-error: true | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| linux: [centos7, ubuntu] | |
| env: | |
| PR_NUMBER: ${{ github.event.number }} | |
| BRANCH: ${{ github.base_ref }} | |
| REPO: ${{ github.repository }} | |
| PRE_COMMIT: ${{ needs.clang-format.outputs.pre_commit }} | |
| PRE_COMMIT_CONCLUSION: ${{ needs.clang-format.outputs.pre_commit_conclusion }} | |
| ONLY_TEST: ${{ needs.clang-format.outputs.only_test }} | |
| BE_CHANGE: ${{ needs.clang-format.outputs.be_change }} | |
| steps: | |
| - name: clean | |
| run: | | |
| rm -rf ${{ github.workspace }} | |
| mkdir -p ${{ github.workspace }} | |
| - name: Download BE Path Filter Artifact | |
| uses: dawidd6/action-download-artifact@v6 | |
| with: | |
| name: be-path-filter | |
| path: be-path-filter | |
| run_id: ${{ github.run_id }} | |
| - name: Parsing path-filter file | |
| id: parsing-path-filter | |
| run: | | |
| cd be-path-filter/; ls; | |
| echo "src_filter=`cat src_filter.txt`" >> $GITHUB_OUTPUT | |
| echo "test_filter.txt=`cat test_filter.txt`" >> $GITHUB_OUTPUT | |
| echo "thirdparty_filter=`cat thirdparty_filter.txt`" >> $GITHUB_OUTPUT | |
| - name: Update Image (${{ matrix.linux }}) | |
| id: update-image | |
| if: > | |
| steps.parsing-path-filter.outputs.thirdparty_filter == 'true' && | |
| (needs.clang-format.outputs.only_test != 'true' || needs.clang-format.outputs.pre_thirdparty_conclusion != 'success') | |
| env: | |
| linux_distro: ${{ matrix.linux }} | |
| run: | | |
| cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh | |
| ./bin/run-pr-update-image.sh | |
| - name: Upload Thirdparty Result | |
| id: upload_thirdparty_result | |
| if: steps.update-image.outcome == 'success' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: THIRDPARTY-RESULT-${{ matrix.linux }} | |
| path: image_cache.info | |
| retention-days: 7 | |
| overwrite: true | |
| if-no-files-found: ignore | |
| - name: Clean ENV | |
| if: always() && steps.parsing-path-filter.outputs.thirdparty_filter == 'true' | |
| run: | | |
| cd ci-tool && source lib/init.sh | |
| ./bin/elastic-cluster.sh --delete | |
| rm -rf ${{ github.workspace }}/* | |
| thirdparty-info: | |
| runs-on: [self-hosted, normal] | |
| needs: | |
| - thirdparty-update | |
| name: Thirdparty Info | |
| outputs: | |
| centos7_image_cache_id: ${{ steps.info.outputs.centos7_image_cache_id }} | |
| ubuntu_image_cache_id: ${{ steps.info.outputs.ubuntu_image_cache_id }} | |
| steps: | |
| - name: Check Result | |
| run: | | |
| rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull >/dev/null | |
| ./scripts/check-thirdparty-result.sh | |
| - name: Download Thirdparty Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: THIRDPARTY-RESULT-* | |
| path: outputs | |
| - name: Read Info | |
| id: info | |
| run: | | |
| image_cache_id=$(cat "./outputs/THIRDPARTY-RESULT-centos7/image_cache.info" || echo "") | |
| echo "centos7_image_cache_id=${image_cache_id}" >> $GITHUB_OUTPUT | |
| image_cache_id=$(cat "./outputs/THIRDPARTY-RESULT-ubuntu/image_cache.info" || echo "") | |
| echo "ubuntu_image_cache_id=${image_cache_id}" >> $GITHUB_OUTPUT | |
| be-ut: | |
| runs-on: [self-hosted, normal] | |
| needs: | |
| - thirdparty-info | |
| - be-checker | |
| timeout-minutes: 150 | |
| name: BE UT | |
| env: | |
| PR_NUMBER: ${{ github.event.number }} | |
| BRANCH: ${{ github.base_ref }} | |
| IMAGE_CACHE_ID: ${{ needs.thirdparty-info.outputs.ubuntu_image_cache_id }} | |
| LINUX_DISTRO: ubuntu | |
| steps: | |
| - name: INIT ECI & RUN UT | |
| id: run_ut | |
| if: needs.be-checker.outputs.be_change == 'true' || needs.be-checker.outputs.pre_ut_conclusion != 'success' | |
| shell: bash | |
| run: | | |
| rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh | |
| if [[ "${IMAGE_CACHE_ID}" != '' ]]; then | |
| export image_cache_id=${IMAGE_CACHE_ID} | |
| export image_tag=$BRANCH-$PR_NUMBER | |
| fi | |
| ./bin/elastic-ut.sh --pr ${PR_NUMBER} --module be --repository ${{ github.repository }} --linuxdistro ${LINUX_DISTRO} --with-gcov | |
| - name: clean ECI | |
| if: always() && steps.run_ut.outputs.ECI_ID != '' | |
| run: | | |
| echo ${{ steps.run_ut.outputs.ECI_ID }} | |
| eci rm ${{ steps.run_ut.outputs.ECI_ID }} || true | |
| - name: Upload Log | |
| uses: actions/upload-artifact@v4 | |
| if: always() && steps.run_ut.outcome == 'failure' && steps.run_ut.outputs.BE_LOG != '' | |
| with: | |
| name: BE UT LOG | |
| path: ${{ steps.run_ut.outputs.BE_LOG }} | |
| retention-days: 3 | |
| overwrite: true | |
| - name: Clean ENV | |
| if: always() | |
| run: | | |
| rm -f ${{ steps.run_ut.outputs.RES_FILE }} | |
| rm -f ${{ steps.run_ut.outputs.RES_LOG }} | |
| rm -rf ${{ steps.run_ut.outputs.BE_LOG }} | |
| rm -rf ${{ github.workspace }}/* | |
| clang-tidy: | |
| runs-on: [self-hosted, normal] | |
| needs: [be-checker, thirdparty-info] | |
| if: success() && needs.be-checker.outputs.src_filter == 'true' && (needs.be-checker.outputs.only_test != 'true' || needs.be-checker.outputs.pre_clang_conclusion != 'success') | |
| timeout-minutes: 90 | |
| name: Clang-Tidy | |
| env: | |
| PR_NUMBER: ${{ github.event.number }} | |
| BRANCH: ${{ github.base_ref }} | |
| IMAGE_CACHE_ID: ${{ needs.thirdparty-info.outputs.ubuntu_image_cache_id }} | |
| LINUX_DISTRO: ubuntu | |
| steps: | |
| - name: clean | |
| run: | | |
| rm -rf ${{ github.workspace }} | |
| mkdir -p ${{ github.workspace }} | |
| - name: BRANCH INFO | |
| id: branch | |
| run: | | |
| echo ${{github.base_ref}} | |
| echo "branch=${{github.base_ref}}" >> $GITHUB_OUTPUT | |
| - name: UPDATE ECI & RUN Clang Tidy | |
| id: run_clang_tidy | |
| shell: bash | |
| timeout-minutes: 90 | |
| run: | | |
| rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh | |
| if [[ "${{ needs.be-checker.outputs.thirdparty_filter }}" == 'true' ]]; then | |
| export image_cache_id=${IMAGE_CACHE_ID} | |
| export image_tag=$BRANCH-$PR_NUMBER | |
| fi | |
| ./bin/elastic-build.sh --pr ${PR_NUMBER} --repository ${{ github.repository }} --linuxdistro ${LINUX_DISTRO} --be --clang-tidy | |
| - name: clean ECI | |
| if: always() && steps.run_clang_tidy.outputs.ECI_ID != '' | |
| run: | | |
| echo ${{ steps.run_clang_tidy.outputs.ECI_ID }} | |
| eci rm ${{ steps.run_clang_tidy.outputs.ECI_ID }} | |
| - name: Clean ENV | |
| if: always() | |
| run: | | |
| rm -f ${{ steps.run_clang_tidy.outputs.RES_FILE }} | |
| rm -f ${{ steps.run_clang_tidy.outputs.RES_LOG }} | |
| rm -rf ${{ github.workspace }}/* | |
| fe-checker: | |
| runs-on: ubuntu-latest | |
| needs: basic-checker | |
| name: FE FILTER | |
| if: needs.basic-checker.outputs.PASS == 'true' | |
| env: | |
| PRE_COMMIT: ${{ needs.basic-checker.outputs.PRE_COMMIT }} | |
| PRE_COMMIT_CONCLUSION: ${{ needs.basic-checker.outputs.PRE_COMMIT_CONCLUSION }} | |
| PRE_COMMIT_JOB_STATUS_DICT: ${{ needs.basic-checker.outputs.PRE_COMMIT_JOB_STATUS_DICT }} | |
| outputs: | |
| src_filter: ${{ steps.path-filter.outputs.fe }} | |
| test_filter: ${{ steps.path-filter.outputs.ut }} | |
| java_filter: ${{ steps.path-filter.outputs.java }} | |
| extension_filter: ${{ steps.path-filter.outputs.extension }} | |
| pom_filter: ${{ steps.path-filter.outputs.pom }} | |
| only_test: ${{ needs.basic-checker.outputs.ONLY_FE_TEST }} | |
| pre_commit_job_status_dict: ${{ needs.basic-checker.outputs.PRE_COMMIT_JOB_STATUS_DICT }} | |
| pre_ut_conclusion: ${{ steps.check_pre_commit_conclusion.outputs.pre_ut_conclusion }} | |
| pre_codestyle_conclusion: ${{ steps.check_pre_commit_conclusion.outputs.pre_codestyle_conclusion }} | |
| pre_sonarcloud_conclusion: ${{ steps.check_pre_commit_conclusion.outputs.pre_sonarcloud_conclusion }} | |
| fe_change: ${{ needs.basic-checker.outputs.FE_CHANGE }} | |
| steps: | |
| - uses: dorny/paths-filter@v3 | |
| id: path-filter | |
| with: | |
| filters: | | |
| fe: | |
| - 'fe/!(**/test/**)**' | |
| - 'gensrc/**' | |
| - 'java-extensions/**' | |
| - 'build.sh' | |
| - '**/pom.xml' | |
| ut: | |
| - 'fe/**/test/**' | |
| - 'run-fe-ut.sh' | |
| java: | |
| - '**.java' | |
| extension: | |
| - 'java-extensions/**' | |
| pom: | |
| - '**/pom.xml' | |
| - name: Prepare info | |
| run: | | |
| mkdir fe-path-filter && cd fe-path-filter | |
| echo ${{ steps.path-filter.outputs.fe }} > src_filter.txt | |
| echo ${{ steps.path-filter.outputs.ut }} > test_filter.txt | |
| echo ${{ steps.path-filter.outputs.java }} > java_filter.txt | |
| echo ${{ steps.path-filter.outputs.extension }} > extension_filter.txt | |
| echo ${{ steps.path-filter.outputs.pom }} > pom_filter.txt | |
| - name: Upload the FE Filter Info | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: fe-path-filter | |
| path: ./fe-path-filter/ | |
| retention-days: 7 | |
| overwrite: true | |
| - name: check pre-commit conclusion | |
| id: check_pre_commit_conclusion | |
| if: (steps.path-filter.outputs.fe == 'true' || steps.path-filter.outputs.ut == 'true') && needs.basic-checker.outputs.ONLY_FE_TEST == 'true' && env.PRE_COMMIT != '' && env.PRE_COMMIT_JOB_STATUS_DICT != '' | |
| run: | | |
| pre_commit_job_status_dict='${{ env.PRE_COMMIT_JOB_STATUS_DICT }}' | |
| pre_ut_conclusion=$(echo $pre_commit_job_status_dict | jq -r '."FE UT"') | |
| pre_codestyle_conclusion=$(echo $pre_commit_job_status_dict | jq -r '."FE Code Style Check"') | |
| pre_sonarcloud_conclusion=$(echo $pre_commit_job_status_dict | jq -r '."FE Sonarcloud Check"') | |
| echo "pre_ut_conclusion=${pre_ut_conclusion}" >> $GITHUB_OUTPUT | |
| echo "pre_codestyle_conclusion=${pre_codestyle_conclusion}" >> $GITHUB_OUTPUT | |
| echo "pre_sonarcloud_conclusion=${pre_sonarcloud_conclusion}" >> $GITHUB_OUTPUT | |
| fe-codestyle-check: | |
| runs-on: ubuntu-latest | |
| needs: fe-checker | |
| if: needs.fe-checker.outputs.src_filter == 'true' || needs.fe-checker.outputs.test_filter == 'true' | |
| name: FE Code Style Check | |
| env: | |
| PR_NUMBER: ${{ github.event.number }} | |
| outputs: | |
| extension_filter: ${{ needs.fe-checker.outputs.extension_filter }} | |
| steps: | |
| - name: clean | |
| id: clean | |
| if: needs.fe-checker.outputs.fe_change == 'true' || needs.fe-checker.outputs.pre_codestyle_conclusion != 'success' | |
| run: | | |
| rm -rf ${{ github.workspace }} | |
| mkdir -p ${{ github.workspace }} | |
| - name: BRANCH INFO | |
| id: branch | |
| if: steps.clean.outcome == 'success' | |
| run: | | |
| echo ${{github.base_ref}} | |
| echo "branch=${{github.base_ref}}" >> $GITHUB_OUTPUT | |
| - uses: actions/checkout@v4 | |
| id: checkout_code | |
| if: steps.branch.outcome == 'success' | |
| with: | |
| fetch-depth: 0 | |
| - name: Checkout PR | |
| id: checkout_pr | |
| if: steps.checkout_code.outcome == 'success' | |
| run: | | |
| BRANCH=${{steps.branch.outputs.branch}} | |
| git config --global user.name "wanpengfei-git"; | |
| git config --global user.email "wanpengfei91@163.com"; | |
| git checkout $BRANCH; | |
| git pull; | |
| BRANCH_NAME="${BRANCH}-${PR_NUMBER}"; | |
| git fetch origin pull/${PR_NUMBER}/head:${BRANCH_NAME}; | |
| git checkout $BRANCH_NAME; | |
| git checkout -b merge_pr; | |
| git merge --squash --no-edit ${BRANCH} || (echo "::error::Merge conflict, please check." && exit -1); | |
| - name: Copy checkstyle files | |
| id: copy_checkstyle_files | |
| if: steps.checkout_pr.outcome == 'success' && needs.fe-checker.outputs.java_filter == 'true' | |
| run: | | |
| cp fe/checkstyle* . | |
| - name: Run java checkstyle | |
| id: run_java_checkstyle | |
| if: steps.copy_checkstyle_files.outcome == 'success' && needs.fe-checker.outputs.java_filter == 'true' | |
| uses: dbelyaev/action-checkstyle@v1.15.0 | |
| with: | |
| workdir: "./fe" | |
| checkstyle_config: checkstyle.xml | |
| reporter: "github-pr-check" | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| fail_on_error: true | |
| level: error | |
| sonarcloud-fe-checker: | |
| runs-on: ubuntu-latest | |
| needs: fe-checker | |
| if: needs.fe-checker.outputs.src_filter == 'true' && github.repository == 'StarRocks/starrocks' | |
| name: FE Sonarcloud Check | |
| timeout-minutes: 60 | |
| env: | |
| PR_NUMBER: ${{ github.event.number }} | |
| CODE_PATH: ${{ github.workspace }} | |
| BRANCH: ${{ github.base_ref }} | |
| GH_TOKEN: ${{ github.token }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| id: checkout_code | |
| if: needs.fe-checker.outputs.fe_change == 'true' || needs.fe-checker.outputs.pre_sonarcloud_conclusion != 'success' | |
| with: | |
| fetch-depth: 0 | |
| - name: BRANCH INFO | |
| id: branch | |
| if: steps.checkout_code.outcome == 'success' | |
| run: | | |
| echo ${{github.base_ref}} | |
| echo "branch=${{github.base_ref}}" >> $GITHUB_OUTPUT | |
| - name: Checkout PR | |
| id: checkout_pr | |
| if: steps.branch.outcome == 'success' | |
| run: | | |
| BRANCH=${{steps.branch.outputs.branch}} | |
| git config --global user.name "wanpengfei-git"; | |
| git config --global user.email "wanpengfei91@163.com"; | |
| git checkout $BRANCH; | |
| git pull; | |
| BRANCH_NAME="${BRANCH}-${PR_NUMBER}"; | |
| git fetch origin pull/${PR_NUMBER}/head:${BRANCH_NAME}; | |
| git checkout $BRANCH_NAME; | |
| git checkout -b merge_pr; | |
| git merge --squash --no-edit ${BRANCH} || (echo "Merge conflict, please check." && exit -1); | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| id: setup_java | |
| if: steps.checkout_pr.outcome == 'success' | |
| with: | |
| java-version: 17 | |
| distribution: "adopt" | |
| - name: Cache SonarCloud packages | |
| id: cache_sonarcloud_packages | |
| if: steps.setup_java.outcome == 'success' | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.sonar/cache | |
| key: ${{ runner.os }}-sonar | |
| restore-keys: ${{ runner.os }}-sonar | |
| - name: Cache Maven packages | |
| id: cache_maven_packages | |
| if: steps.cache_sonarcloud_packages.outcome == 'success' | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2 | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: ${{ runner.os }}-maven | |
| - name: Install Apache Thrift 0.13 | |
| id: install_thrift_0_13 | |
| if: steps.cache_maven_packages.outcome == 'success' | |
| run: | | |
| mkdir -p ./.setup-thrift/oras | |
| mkdir -p ./.setup-thrift/thrift | |
| curl -sLO https://github.com/deislabs/oras/releases/download/v0.7.0/oras_0.7.0_linux_amd64.tar.gz | |
| tar -xvzf oras_0.7.0_linux_amd64.tar.gz | |
| ln -sf $(pwd)/oras /usr/local/bin/oras | |
| oras pull ghcr.io/dodopizza/setup-thrift/binaries:v0.13.0 --media-type application/vnd.unknown.layer.v1+tar.gz | |
| tar zxf ./thrift.v0.13.0.tar.gz -C . | |
| ln -sf $(pwd)/thrift /usr/local/bin/thrift | |
| - name: Analyze FE | |
| id: analyze_fe | |
| if: steps.install_thrift_0_13.outcome == 'success' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
| SONAR_TOKEN: f0fb4d25c03bae90c2e994c45c29c49dc86fc169 # ${{ secrets.SONAR_TOKEN }} | |
| run: | | |
| thrift --version | |
| whereis thrift | |
| export STARROCKS_HOME=${{ github.workspace }} | |
| source env.sh | |
| mkdir -p thirdparty/installed/bin/ | |
| cd thirdparty/installed/bin/ && ln -s /usr/local/bin/thrift thrift | |
| cd ${{ github.workspace }}/fe | |
| export SONAR_SCANNER_OPTS="-Xms3072m -Xmx12288m" | |
| export MAVEN_OPTS="-Xms3072m -Xmx12288m" | |
| mvn -B -DskipTests verify org.sonarsource.scanner.maven:sonar-maven-plugin:4.0.0.4121:sonar \ | |
| -Dsonar.projectKey=StarRocks_starrocks -Dsonar.pullrequest.key=${{ github.event.number }} \ | |
| -Dsonar.pullrequest.base=${{ github.base_ref }} -Dsonar.pullrequest.branch=${{ github.head_ref }} | |
| fe-ut: | |
| runs-on: [self-hosted, normal] | |
| needs: | |
| - fe-codestyle-check | |
| - fe-checker | |
| name: FE UT | |
| env: | |
| PR_NUMBER: ${{ github.event.number }} | |
| CODE_PATH: ${{ github.workspace }} | |
| BRANCH: ${{ github.base_ref }} | |
| GH_TOKEN: ${{ github.token }} | |
| steps: | |
| - name: clean | |
| run: | | |
| rm -rf ${{ github.workspace }} | |
| mkdir -p ${{ github.workspace }} | |
| - name: BRANCH INFO | |
| id: branch | |
| if: needs.fe-checker.outputs.fe_change == 'true' || needs.fe-checker.outputs.pre_ut_conclusion != 'success' | |
| run: | | |
| echo "branch=${{github.base_ref}}" >> $GITHUB_OUTPUT | |
| repo="${{ github.repository }}" | |
| bucket_prefix=`echo ${repo%/*} | tr '[:upper:]' '[:lower:]'` | |
| echo "bucket_prefix=${bucket_prefix}" >> $GITHUB_OUTPUT | |
| - name: UPDATE ECI & RUN UT | |
| id: run_ut | |
| if: steps.branch.outcome == 'success' | |
| shell: bash | |
| timeout-minutes: 90 | |
| env: | |
| EXTENSION: ${{ needs.fe-codestyle-check.outputs.extension_filter }} | |
| run: | | |
| rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh | |
| ./bin/elastic-ut.sh --pr ${PR_NUMBER} --module fe --branch ${{steps.branch.outputs.branch}} --build Release --repository ${{ github.repository }} --linuxdistro ubuntu | |
| - name: Clean ECI | |
| if: always() && steps.run_ut.outputs.ECI_ID != '' | |
| run: | | |
| echo ${{ steps.run_ut.outputs.ECI_ID }} | |
| echo "::group::>>> Dmesg info:" | |
| eci exec ${{ steps.run_ut.outputs.ECI_ID }} bash -c "dmesg -T" | |
| echo "::endgroup::" | |
| eci rm ${{ steps.run_ut.outputs.ECI_ID }} | |
| - name: Upload log | |
| if: always() && steps.run_ut.outputs.RES_LOG != '' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: FE UT LOG | |
| path: ${{ steps.run_ut.outputs.RES_LOG }} | |
| retention-days: 3 | |
| overwrite: true | |
| - name: Clean ENV | |
| if: always() | |
| run: | | |
| rm -rf ${{ steps.run_ut.outputs.FE_REPORT_DIR }} | |
| rm -f ${{ steps.run_ut.outputs.RES_FILE }} | |
| rm -f ${{ steps.run_ut.outputs.RES_LOG }} | |
| rm -rf ${{ steps.run_ut.outputs.COV_DIR }} | |
| rm -rf ${{ github.workspace }}/* | |
| test-checker: | |
| runs-on: ubuntu-latest | |
| needs: basic-checker | |
| name: TEST FILTER | |
| if: needs.basic-checker.outputs.PASS == 'true' | |
| env: | |
| PRE_COMMIT: ${{ needs.basic-checker.outputs.PRE_COMMIT }} | |
| PRE_COMMIT_CONCLUSION: ${{ needs.basic-checker.outputs.PRE_COMMIT_CONCLUSION }} | |
| PRE_COMMIT_JOB_STATUS_DICT: ${{ needs.basic-checker.outputs.PRE_COMMIT_JOB_STATUS_DICT }} | |
| outputs: | |
| test_change: ${{ steps.path-filter.outputs.test }} | |
| pre_build_conclusion: ${{ steps.check-integration-test-results.outputs.pre_build_conclusion }} | |
| steps: | |
| - uses: dorny/paths-filter@v3 | |
| id: path-filter | |
| with: | |
| filters: | | |
| test: | |
| - 'test/**' | |
| - name: Check integration test results | |
| id: check-integration-test-results | |
| if: env.PRE_COMMIT != '' && env.PRE_COMMIT_JOB_STATUS_DICT != '' | |
| run: | | |
| pre_commit_job_status_dict='${{ env.PRE_COMMIT_JOB_STATUS_DICT }}' | |
| pre_build_conclusion=$(echo $pre_commit_job_status_dict | jq -r '."BUILD"') | |
| echo "pre_build_conclusion=${pre_build_conclusion}" >> $GITHUB_OUTPUT | |
| build: | |
| runs-on: [self-hosted, normal] | |
| needs: [basic-checker, test-checker, thirdparty-info, fe-codestyle-check, clang-format] | |
| name: BUILD | |
| env: | |
| PR_NUMBER: ${{ github.event.number }} | |
| BRANCH: ${{ github.base_ref }} | |
| IMAGE_CACHE_ID: ${{ needs.thirdparty-info.outputs.ubuntu_image_cache_id }} | |
| LINUX_DISTRO: ubuntu | |
| GH_TOKEN: ${{ github.token }} | |
| ONLY_BE_TEST: ${{ needs.basic-checker.outputs.ONLY_BE_TEST }} | |
| ONLY_FE_TEST: ${{ needs.basic-checker.outputs.ONLY_FE_TEST }} | |
| PRE_COMMIT: ${{ needs.basic-checker.outputs.PRE_COMMIT }} | |
| PRE_COMMIT_CONCLUSION: ${{ needs.basic-checker.outputs.PRE_COMMIT_CONCLUSION }} | |
| PRE_COMMIT_JOB_STATUS_DICT: ${{ needs.basic-checker.outputs.PRE_COMMIT_JOB_STATUS_DICT }} | |
| outputs: | |
| build_be_output_tar: ${{ steps.run_build.outputs.BE_OUTPUT_TAR }} | |
| build_fe_output_tar: ${{ steps.run_build.outputs.FE_OUTPUT_TAR }} | |
| base_version: ${{ steps.run_build.outputs.BASE_VERSION }} | |
| is_self_build: ${{ steps.run_build.outputs.is_self_build }} | |
| test_pr: ${{ needs.basic-checker.outputs.TEST_PR }} | |
| sys_test_need: ${{ steps.run_build.outputs.sys_test_need }} | |
| pre_commit_job_status_dict: ${{ needs.basic-checker.outputs.PRE_COMMIT_JOB_STATUS_DICT }} | |
| if: > | |
| always() && | |
| needs.thirdparty-info.result != 'failure' && | |
| needs.fe-codestyle-check.result != 'failure' && | |
| needs.clang-format.result != 'failure' && | |
| (needs.thirdparty-info.result == 'success' || needs.fe-codestyle-check.result == 'success' || needs.test-checker.outputs.test_change == 'true') | |
| steps: | |
| - name: CLEAN | |
| run: | | |
| rm -rf ${{ github.workspace }} && mkdir -p ${{ github.workspace }} | |
| - name: check sync | |
| id: check-sync | |
| run: | | |
| labels=`gh pr view ${PR_NUMBER} -R ${GITHUB_REPOSITORY} --json labels -q '.labels[].name'` | |
| echo "${labels}" | |
| if [[ "${labels}" =~ sync ]]; then | |
| echo "IS_SYNC=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Download BE Path Filter Artifact | |
| uses: dawidd6/action-download-artifact@v6 | |
| if: steps.check-sync.outputs.IS_SYNC != 'true' | |
| with: | |
| name: be-path-filter | |
| path: be-path-filter | |
| if_no_artifact_found: fail | |
| run_id: ${{ github.run_id }} | |
| - name: Download FE Path Filter Artifact | |
| uses: dawidd6/action-download-artifact@v6 | |
| if: steps.check-sync.outputs.IS_SYNC != 'true' | |
| with: | |
| name: fe-path-filter | |
| path: fe-path-filter | |
| if_no_artifact_found: fail | |
| run_id: ${{ github.run_id }} | |
| - name: Parsing BE path-filter file | |
| id: parsing-be-path-filter | |
| if: steps.check-sync.outputs.IS_SYNC != 'true' | |
| run: | | |
| if [[ -e be-path-filter ]]; then | |
| cd be-path-filter/; ls; | |
| echo "src_filter=`cat src_filter.txt`" >> $GITHUB_OUTPUT | |
| echo "test_filter.txt=`cat test_filter.txt`" >> $GITHUB_OUTPUT | |
| echo "thirdparty_filter=`cat thirdparty_filter.txt`" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Parsing FE path-filter file | |
| id: parsing-fe-path-filter | |
| if: steps.check-sync.outputs.IS_SYNC != 'true' | |
| run: | | |
| if [[ -e fe-path-filter ]]; then | |
| cd fe-path-filter/; ls; | |
| echo "src_filter=`cat src_filter.txt`" >> $GITHUB_OUTPUT | |
| echo "test_filter.txt=`cat test_filter.txt`" >> $GITHUB_OUTPUT | |
| echo "java_filter=`cat java_filter.txt`" >> $GITHUB_OUTPUT | |
| echo "extension_filter=`cat extension_filter.txt`" >> $GITHUB_OUTPUT | |
| echo "pom_filter=`cat pom_filter.txt`" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.base_ref }} | |
| - name: UPDATE ECI & RUN BUILD | |
| id: run_build | |
| shell: bash | |
| timeout-minutes: 90 | |
| if: steps.check-sync.outputs.IS_SYNC != 'true' | |
| env: | |
| package: ${{ env.package }} | |
| pr_pom_change: ${{ steps.parsing-fe-path-filter.outputs.pom_filter }} | |
| pr_be_change: ${{ steps.parsing-be-path-filter.outputs.src_filter }} | |
| pr_fe_change: ${{ steps.parsing-fe-path-filter.outputs.src_filter }} | |
| run: | | |
| rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh | |
| if [[ "${{ steps.parsing-be-path-filter.outputs.thirdparty_filter }}" == 'true' ]]; then | |
| export image_cache_id=${IMAGE_CACHE_ID} | |
| export image_tag=$BRANCH-$PR_NUMBER | |
| fi | |
| ./bin/elastic-build.sh --pr ${PR_NUMBER} --repository ${{ github.repository }} --linuxdistro ${LINUX_DISTRO} --with-gcov --with-trivy | |
| if [[ "${sys_test_need}" == "" ]]; then | |
| if [[ "${{ env.pr_pom_change}}" == 'true' || "${{ env.pr_be_change}}" == 'true' || "${{ env.pr_fe_change}}" == 'true' || "${{ needs.test-checker.outputs.test_change }}" == 'true' ]]; then | |
| echo "sys_test_need=true" >> $GITHUB_OUTPUT | |
| fi | |
| else | |
| echo "sys_test_need=${sys_test_need}" >> $GITHUB_OUTPUT | |
| fi | |
| - name: build result | |
| id: build_result | |
| if: steps.run_build.outcome == 'success' | |
| run: | | |
| echo ${{ steps.run_build.outputs.BE_OUTPUT_TAR }} | |
| echo ${{ steps.run_build.outputs.FE_OUTPUT_TAR }} | |
| echo ${{ steps.run_build.outputs.BASE_VERSION }} > ./base_version.txt | |
| - name: Upload the Base Version | |
| uses: actions/upload-artifact@v4 | |
| if: steps.build_result.outcome == 'success' | |
| with: | |
| name: base_version | |
| path: ./base_version.txt | |
| retention-days: 7 | |
| overwrite: true | |
| - name: Clean ENV | |
| if: always() | |
| run: | | |
| rm -f ${{ steps.run_build.outputs.RES_FILE }} | |
| rm -f ${{ steps.run_build.outputs.RES_LOG }} | |
| deploy: | |
| runs-on: [self-hosted, normal] | |
| needs: build | |
| if: always() && needs.build.result == 'success' && needs.build.outputs.sys_test_need == 'true' | |
| name: DEPLOY SR | |
| env: | |
| PR_NUMBER: ${{ github.event.number }} | |
| LINUX_DISTRO: ubuntu | |
| BE_OUTPUT_TAR: ${{ needs.build.outputs.build_be_output_tar }} | |
| FE_OUTPUT_TAR: ${{ needs.build.outputs.build_fe_output_tar }} | |
| outputs: | |
| fe: ${{steps.deploy_sr.outputs.fe}} | |
| be: ${{steps.deploy_sr.outputs.be}} | |
| deploy_conf_file: ${{steps.apply_resource.outputs.deploy_conf_file}} | |
| cluster_name: ${{steps.deploy_sr.outputs.cluster_name}} | |
| be_list: ${{steps.deploy_sr.outputs.be_list}} | |
| shared_data: ${{steps.choose-mode.outputs.cloud}} | |
| is_self_build: ${{ needs.build.outputs.is_self_build }} | |
| test_pr: ${{ needs.build.outputs.test_pr }} | |
| pre_commit_job_status_dict: ${{ needs.build.outputs.pre_commit_job_status_dict}} | |
| steps: | |
| - name: Clean Workspace | |
| uses: AutoModality/action-clean@v1.1.0 | |
| - name: Choose mode | |
| id: choose-mode | |
| run: | | |
| rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh | |
| cluster_type=$(./bin/choose-mode.sh) | |
| if [[ "${cluster_type}" == "cloud" ]]; then | |
| echo "cloud=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Apply for resources | |
| id: apply_resource | |
| env: | |
| CLUSTER_NAME: ci-admit | |
| run: | | |
| cd ci-tool && source lib/init.sh | |
| ./bin/elastic-cluster.sh --template ${CLUSTER_NAME} --linuxdistro ${LINUX_DISTRO} | |
| cp conf/starrocks_deploy.conf /var/local/env/${PR_NUMBER}-starrocks_deploy.conf | |
| echo "deploy_conf_file=/var/local/env/${PR_NUMBER}-starrocks_deploy.conf" >> $GITHUB_OUTPUT | |
| - name: Deploy SR | |
| id: deploy_sr | |
| env: | |
| CLUSTER_NAME: "${{ steps.choose-mode.outputs.cloud == 'true' && 'ci-admit-cloud' || 'ci-admit' }}" | |
| repo: ${{ github.repository }} | |
| run: | | |
| cd ci-tool && source lib/init.sh | |
| echo "##### Package(BE): ${BE_OUTPUT_TAR}" >> $GITHUB_STEP_SUMMARY | |
| echo "##### Package(FE): ${FE_OUTPUT_TAR}" >> $GITHUB_STEP_SUMMARY | |
| echo "cluster_name=${CLUSTER_NAME}" >> $GITHUB_OUTPUT | |
| ./bin/deploy-cluster.sh -c ${CLUSTER_NAME} --with-coverage | |
| - name: Clean ENV | |
| if: always() | |
| run: | | |
| echo "FE: ${{steps.deploy_sr.outputs.fe}}, BE: ${{steps.deploy_sr.outputs.be}}" | |
| rm -rf ${{ github.workspace }}/* | |
| docgen: | |
| runs-on: [self-hosted, normal] | |
| needs: deploy | |
| name: Generate Documentation | |
| if: > | |
| contains(github.event.pull_request.labels.*.name, 'docgen') | |
| env: | |
| PR_NUMBER: ${{ github.event.number }} | |
| FE_NODE: ${{ needs.deploy.outputs.fe }} | |
| BRANCH: ${{ github.base_ref }} | |
| steps: | |
| - uses: dorny/paths-filter@v3 | |
| id: path-filter | |
| with: | |
| filters: | | |
| be-config: | |
| - 'be/src/common/config.h' | |
| fe-config: | |
| - 'fe/fe-core/src/main/java/com/starrocks/common/Config.java' | |
| variable: | |
| - 'fe/fe-core/src/main/java/com/starrocks/qe/GlobalVariable.java' | |
| - 'fe/fe-core/src/main/java/com/starrocks/qe/SessionVariable.java' | |
| function: | |
| - 'gensrc/script/functions.py' | |
| - name: init doc-agent | |
| id: init-doc-agent | |
| run: | | |
| rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && ./lib/init_doc.sh | |
| ./bin/doc-checkout.sh --repository ${{ github.repository }} --branch ${BRANCH} --pr ${PR_NUMBER} | |
| - name: FE config | |
| id: fe-config-gen | |
| if: steps.path-filter.outputs.fe-config == 'true' | |
| run: | | |
| ./ci-tool/bin/run-doc-gen.sh --type fe_config --sr starrocks --limit 5 | |
| result=$(grep -Eao 'Created Pull Request:.+' /root/DocsAgent/logs/*.log) | |
| echo "PR_RESULT=${result}" >> $GITHUB_OUTPUT | |
| - name: BE config | |
| id: be-config-gen | |
| if: steps.path-filter.outputs.be-config == 'true' | |
| run: | | |
| ./ci-tool/bin/run-doc-gen.sh --type be_config --sr starrocks --limit 5 | |
| result=$(grep -Eao 'Created Pull Request:.+' /root/DocsAgent/logs/*.log) | |
| echo "PR_RESULT=${result}" >> $GITHUB_OUTPUT | |
| - name: variables | |
| id: variables-gen | |
| if: steps.path-filter.outputs.variable == 'true' | |
| run: | | |
| ./ci-tool/bin/run-doc-gen.sh --type variables --sr starrocks --limit 5 | |
| result=$(grep -Eao 'Created Pull Request:.+' /root/DocsAgent/logs/*.log) | |
| echo "PR_RESULT=${result}" >> $GITHUB_OUTPUT | |
| - name: function | |
| id: function-gen | |
| if: steps.path-filter.outputs.function == 'true' | |
| run: | | |
| ./ci-tool/bin/run-doc-gen.sh --type functions --sr starrocks --fe ${FE_NODE} --limit 5 | |
| result=$(grep -Eao 'Created Pull Request:.+' /root/DocsAgent/logs/*.log) | |
| echo "PR_RESULT=${result}" >> $GITHUB_OUTPUT | |
| - name: Comment DocGen Result | |
| if: > | |
| (steps.fe-config-gen.outputs.PR_RESULT != '' ) || | |
| (steps.be-config-gen.outputs.PR_RESULT != '' ) || | |
| (steps.variables-gen.outputs.PR_RESULT != '' ) || | |
| (steps.function-gen.outputs.PR_RESULT != '' ) | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| FE_RES: ${{ steps.fe-config-gen.outputs.PR_RESULT }} | |
| BE_RES: ${{ steps.be-config-gen.outputs.PR_RESULT }} | |
| VAR_RES: ${{ steps.variables-gen.outputs.PR_RESULT }} | |
| FUNC_RES: ${{ steps.function-gen.outputs.PR_RESULT }} | |
| run: | | |
| link="${FE_RES}" | |
| [[ -z "$link" ]] && link="${BE_RES}" | |
| [[ -z "$link" ]] && link="${VAR_RES}" | |
| [[ -z "$link" ]] && link="${FUNC_RES}" | |
| if [[ -z "$link" ]]; then | |
| echo "No PR_RESULT found, skip comment." | |
| exit 0 | |
| fi | |
| comment="## 📄 DocsAgent | |
| \n\n Generate Documents PR: ${link}\n- FE Config: ${FE_RES}\n- BE Config: ${BE_RES}\n- Variables: ${VAR_RES}\n- Function: ${FUNC_RES}\n\n(Generated by [DocsAgent](https://github.com/starrocks/docsagent))" | |
| gh pr comment ${{ github.event.number }} -R ${{ github.repository }} -b "${comment}" | |
| - name: Remove docgen label | |
| if: always() | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh pr edit ${{ github.event.number }} -R ${{ github.repository }} --remove-label "docgen" | |
| SQL-Tester: | |
| runs-on: [self-hosted, normal] | |
| name: SQL-Tester | |
| needs: [build, deploy] | |
| if: always() && needs.deploy.result == 'success' | |
| timeout-minutes: 60 | |
| env: | |
| PR_NUMBER: ${{ github.event.number }} | |
| CLUSTER_NAME: ${{ needs.deploy.outputs.cluster_name }} | |
| FE_NODE: ${{ needs.deploy.outputs.fe }} | |
| BE_NODE: ${{ needs.deploy.outputs.be }} | |
| BASE_VERSION: ${{ needs.build.outputs.base_version }} | |
| outputs: | |
| MYSQL_ECI_ID: ${{ steps.run_case.outputs.MYSQL_ECI_ID }} | |
| MYSQL_ECI_IP: ${{ steps.run_case.outputs.MYSQL_ECI_IP }} | |
| steps: | |
| - name: CLEAN | |
| run: | | |
| rm -rf ${{ github.workspace }} && mkdir -p ${{ github.workspace }} | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: BRANCH INFO | |
| id: branch | |
| run: | | |
| echo "branch=${{github.base_ref}}" >> $GITHUB_OUTPUT | |
| repo="${{ github.repository }}" | |
| bucket_prefix=`echo ${repo%/*} | tr '[:upper:]' '[:lower:]'` | |
| echo "bucket_prefix=${bucket_prefix}" >> $GITHUB_OUTPUT | |
| - name: Checkout PR | |
| run: | | |
| BRANCH=${{steps.branch.outputs.branch}} | |
| git config --global user.name "wanpengfei-git"; | |
| git config --global user.email "wanpengfei91@163.com"; | |
| git checkout $BRANCH; | |
| git reset ${BASE_VERSION} --hard || true; | |
| BRANCH_NAME="${BRANCH}-${PR_NUMBER}"; | |
| git fetch origin pull/${PR_NUMBER}/head:${BRANCH_NAME}; | |
| git checkout $BRANCH_NAME; | |
| git checkout -b merge_pr; | |
| git merge --squash --no-edit ${BRANCH} || (echo "::error::Merge conflict, please check." && exit -1); | |
| - name: Run Case (${{ needs.deploy.outputs.fe }}) | |
| id: run_case | |
| env: | |
| is_self_build: ${{ needs.deploy.outputs.is_self_build }} | |
| run: | | |
| rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh | |
| ./bin/run-sql-tester.sh | |
| - name: Upload SQL-Tester XML | |
| if: success() || failure() | |
| run: | | |
| branch=${{ steps.branch.outputs.branch }} | |
| bucket_prefix=${{ steps.branch.outputs.bucket_prefix }} | |
| xml_oss_path=oss://${bucket_prefix}-ci-release/$branch/Release/pr/SQL-Tester-XML/${PR_NUMBER}/ | |
| ossutil64 --config-file ~/.ossutilconfig rm ${xml_oss_path} -rf | |
| ossutil64 --config-file ~/.ossutilconfig cp test/ ${xml_oss_path} --include "*.xml" --recursive --force --tagging="type=ci" | |
| - name: Upload log | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: SQL-Tester Log | |
| path: | | |
| test/log/ | |
| test/crash_logs/ | |
| retention-days: 3 | |
| overwrite: true | |
| if-no-files-found: ignore | |
| - name: Clean ENV | |
| if: always() | |
| run: | | |
| rm -rf ${{ github.workspace }}/* | |
| restart-fe: | |
| runs-on: [self-hosted, normal] | |
| name: Restart FE | |
| needs: [deploy, SQL-Tester] | |
| if: always() && needs.SQL-Tester.result == 'success' | |
| env: | |
| PR_NUMBER: ${{ github.event.number }} | |
| CLUSTER_NAME: ${{ needs.deploy.outputs.cluster_name }} | |
| FE_NODE: ${{ needs.deploy.outputs.fe }} | |
| outputs: | |
| MYSQL_ECI_IP: ${{ needs.SQL-Tester.outputs.MYSQL_ECI_IP }} | |
| steps: | |
| - name: CLEAN | |
| run: | | |
| rm -rf ${{ github.workspace }} && mkdir -p ${{ github.workspace }} | |
| - name: Restart FE (${{needs.deploy.outputs.fe}}) | |
| run: | | |
| rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh | |
| ./bin/restart-fe.sh --pr ${PR_NUMBER} --branch ${{ github.base_ref }} --build Release --repository ${{ github.repository }} | |
| - name: Clean ENV | |
| if: always() | |
| run: | | |
| rm -rf ${{ github.workspace }}/* | |
| restart-be: | |
| runs-on: [self-hosted, normal] | |
| name: Restart BE | |
| needs: [deploy, SQL-Tester] | |
| if: always() && needs.SQL-Tester.result == 'success' | |
| timeout-minutes: 20 | |
| env: | |
| PR_NUMBER: ${{ github.event.number }} | |
| CLUSTER_NAME: ${{ needs.deploy.outputs.cluster_name }} | |
| FE_NODE: ${{ needs.deploy.outputs.fe }} | |
| BE_NODE: ${{ needs.deploy.outputs.be }} | |
| BE_LIST: ${{ needs.deploy.outputs.be_list }} | |
| steps: | |
| - name: CLEAN | |
| run: | | |
| rm -rf ${{ github.workspace }} && mkdir -p ${{ github.workspace }} | |
| - name: Restart BE (${{needs.deploy.outputs.be_list}}) | |
| run: | | |
| rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh | |
| [[ "${{ needs.deploy.outputs.is_self_build }}" != "true" ]] && gcov_cmd="--skip-gcov" | |
| ./bin/system-cov-be.sh \ | |
| --pr ${PR_NUMBER} \ | |
| --branch ${{ github.base_ref }} \ | |
| --build Release \ | |
| --repository ${{ github.repository }} \ | |
| --gcov_next_suffix admit ${gcov_cmd} | |
| - name: Clean ENV | |
| if: always() | |
| run: | | |
| rm -rf ${{ github.workspace }}/* | |
| admit: | |
| runs-on: [self-hosted, normal] | |
| name: ADMIT TEST | |
| needs: [deploy, restart-fe, restart-be] | |
| if: always() && needs.restart-fe.result == 'success' && needs.restart-be.result == 'success' && needs.deploy.outputs.is_self_build == 'true' | |
| timeout-minutes: 40 | |
| env: | |
| PR_NUMBER: ${{ github.event.number }} | |
| CLUSTER_NAME: ${{ needs.deploy.outputs.cluster_name }} | |
| FE_NODE: ${{ needs.deploy.outputs.fe }} | |
| BE_NODE: ${{ needs.deploy.outputs.be }} | |
| TEST_PR: ${{ needs.deploy.outputs.test_pr }} | |
| MYSQL_ECI_IP: ${{ needs.restart-fe.outputs.MYSQL_ECI_IP }} | |
| steps: | |
| - name: CLEAN | |
| run: | | |
| rm -rf ${{ github.workspace }} && mkdir -p ${{ github.workspace }} | |
| - name: BRANCH INFO | |
| id: branch | |
| run: | | |
| echo "branch=${{github.base_ref}}" >> $GITHUB_OUTPUT | |
| repo="${{ github.repository }}" | |
| bucket_prefix=`echo ${repo%/*} | tr '[:upper:]' '[:lower:]'` | |
| echo "bucket_prefix=${bucket_prefix}" >> $GITHUB_OUTPUT | |
| - name: Run Case | |
| env: | |
| BRANCH: ${{ steps.branch.outputs.branch }} | |
| run: | | |
| rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh | |
| cd ${{ github.workspace }}/.. | |
| rm -rf ./StarRocksTest && cp -rf /var/lib/StarRocksTest ./StarRocksTest && cd ./StarRocksTest && git pull >/dev/null | |
| if [[ "${TEST_PR}" != "" ]]; then | |
| echo "Test pr: ${TEST_PR}..." | |
| BRANCH_NAME="${BRANCH}-${PR_NUMBER}" | |
| git fetch origin pull/${TEST_PR}/head:${BRANCH_NAME} | |
| git checkout $BRANCH_NAME | |
| git checkout -b merge_pr | |
| git merge --squash --no-edit master || (echo "::error::Merge conflict, please check." && exit -1); | |
| fi | |
| mv ${{ github.workspace }}/../StarRocksTest ${{ github.workspace }}/StarRocksTest | |
| cd ${{ github.workspace }}/ci-tool | |
| if [[ "${{ needs.deploy.outputs.shared_data }}" == "true" ]]; then | |
| cluster_type=cloud | |
| else | |
| cluster_type=native | |
| fi | |
| ./bin/run-admit-single.sh --pr ${PR_NUMBER} --branch ${{steps.branch.outputs.branch}} --build Release --repository ${{ github.repository }} --cluster ${cluster_type} | |
| - name: Upload Admit XML | |
| if: success() || failure() | |
| run: | | |
| branch=${{ steps.branch.outputs.branch }} | |
| bucket_prefix=${{ steps.branch.outputs.bucket_prefix }} | |
| xml_oss_path=oss://${bucket_prefix}-ci-release/$branch/Release/pr/Admit-XML/${PR_NUMBER}/ | |
| ossutil64 --config-file ~/.ossutilconfig rm ${xml_oss_path} -rf | |
| ossutil64 --config-file ~/.ossutilconfig cp StarRocksTest/nosetests.xml ${xml_oss_path} -f | |
| ossutil64 --config-file ~/.ossutilconfig cp StarRocksTest/result ${xml_oss_path} --include "*.xml" -rf | |
| - name: Clean ENV | |
| if: always() | |
| run: | | |
| rm -rf ${{ github.workspace }}/* | |
| restart-fe-after-admit: | |
| runs-on: [self-hosted, normal] | |
| name: Restart FE(Admit) | |
| needs: [deploy, admit] | |
| if: always() && needs.admit.result == 'success' | |
| timeout-minutes: 20 | |
| env: | |
| PR_NUMBER: ${{ github.event.number }} | |
| CLUSTER_NAME: ${{ needs.deploy.outputs.cluster_name }} | |
| FE_NODE: ${{ needs.deploy.outputs.fe }} | |
| BE_NODE: ${{ needs.deploy.outputs.be }} | |
| BE_LIST: ${{ needs.deploy.outputs.be_list }} | |
| steps: | |
| - name: CLEAN | |
| run: | | |
| rm -rf ${{ github.workspace }} && mkdir -p ${{ github.workspace }} | |
| - name: Restart FE (${{needs.deploy.outputs.be_list}}) | |
| run: | | |
| rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh | |
| ./bin/restart-fe.sh \ | |
| --pr ${PR_NUMBER} \ | |
| --branch ${{ github.base_ref }} \ | |
| --build Release \ | |
| --exec-module admit \ | |
| --repository ${{ github.repository }} \ | |
| --exec-module admit | |
| - name: Clean ENV | |
| if: always() | |
| run: | | |
| rm -rf ${{ github.workspace }}/* | |
| restart-be-after-admit: | |
| runs-on: [self-hosted, normal] | |
| name: Restart BE(Admit) | |
| needs: [deploy, admit] | |
| if: always() && needs.admit.result == 'success' | |
| timeout-minutes: 20 | |
| env: | |
| PR_NUMBER: ${{ github.event.number }} | |
| CLUSTER_NAME: ${{ needs.deploy.outputs.cluster_name }} | |
| FE_NODE: ${{ needs.deploy.outputs.fe }} | |
| BE_NODE: ${{ needs.deploy.outputs.be }} | |
| BE_LIST: ${{ needs.deploy.outputs.be_list }} | |
| steps: | |
| - name: CLEAN | |
| run: | | |
| rm -rf ${{ github.workspace }} && mkdir -p ${{ github.workspace }} | |
| - name: Restart BE (${{needs.deploy.outputs.be_list}}) | |
| run: | | |
| rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh | |
| [[ "${{ needs.deploy.outputs.is_self_build }}" != "true" ]] && gcov_cmd="--skip-gcov" | |
| ./bin/system-cov-be.sh \ | |
| --pr ${PR_NUMBER} \ | |
| --branch ${{ github.base_ref }} \ | |
| --build Release \ | |
| --repository ${{ github.repository }} \ | |
| --gcov_pre_suffix admit --restart-without-gcov ${gcov_cmd} | |
| - name: Clean ENV | |
| if: always() | |
| run: | | |
| rm -rf ${{ github.workspace }}/* | |
| Teardown: | |
| runs-on: [self-hosted, quick] | |
| name: Teardown | |
| needs: | |
| - deploy | |
| - SQL-Tester | |
| - restart-fe-after-admit | |
| - restart-be-after-admit | |
| - fe-ut | |
| - be-ut | |
| if: always() | |
| env: | |
| PR_NUMBER: ${{ github.event.number }} | |
| BRANCH: ${{ github.base_ref }} | |
| CONF_FILE: ${{ needs.deploy.outputs.deploy_conf_file }} | |
| linuxdistro: ubuntu | |
| steps: | |
| - name: Upload info | |
| run: | | |
| echo $PR_NUMBER > pr_num.txt | |
| - name: Upload the PR number | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pr_num | |
| path: ./pr_num.txt | |
| retention-days: 7 | |
| overwrite: true | |
| - name: Backup SR Info | |
| if: needs.deploy.outputs.deploy_conf_file != '' | |
| id: backup | |
| run: | | |
| rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh | |
| ./bin/backup_log_cores.sh \ | |
| --branch $BRANCH \ | |
| --pr $PR_NUMBER \ | |
| --build Release \ | |
| --linuxdistro "${{ env.linuxdistro }}" \ | |
| --conf $CONF_FILE \ | |
| --repository ${{ github.repository }} | |
| - name: Clean ECS | |
| if: steps.backup.outcome == 'success' | |
| run: | | |
| cd ci-tool && source lib/init.sh | |
| ./bin/elastic-cluster.sh --delete | |
| - name: clean ECI | |
| if: always() && needs.SQL-Tester.outputs.MYSQL_ECI_ID != '' | |
| run: | | |
| eci rm ${{ needs.SQL-Tester.outputs.MYSQL_ECI_ID }} | |
| - name: Clean | |
| if: always() | |
| run: | | |
| rm -f $CONF_FILE | |
| rm -rf ${{ github.workspace }}/* |