From 21ffb7595ff5c0f6155c8a646697c98121665ec0 Mon Sep 17 00:00:00 2001 From: andyziye <108652123+andyziye@users.noreply.github.com> Date: Thu, 27 Jul 2023 19:46:38 +0800 Subject: [PATCH] [Tool] Update thirdparty for sync pr (#28099) Signed-off-by: AndyZiYe --- .github/workflows/ci-merged.yml | 6 +++- .github/workflows/ci-pipeline-branch.yml | 36 ++++++++++++++++++------ .github/workflows/ci-pipeline.yml | 28 ++++++++++++++---- 3 files changed, 56 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-merged.yml b/.github/workflows/ci-merged.yml index c1344ebea0d65..87cb9fb78deff 100644 --- a/.github/workflows/ci-merged.yml +++ b/.github/workflows/ci-merged.yml @@ -13,6 +13,7 @@ jobs: if: > ${{ github.event.pull_request.merged == true }} && github.base_ref == 'main' && + github.repository == 'StarRocks/starrocks' && !contains(github.event.pull_request.title, 'cherry-pick') && !contains(github.event.pull_request.title, 'backport') && ( contains(github.event.pull_request.labels.*.name, '3.1') || @@ -109,7 +110,10 @@ jobs: close_msg: runs-on: self-hosted - if: github.event.pull_request.merged == true && github.base_ref == 'main' + if: > + github.event.pull_request.merged == true && + github.base_ref == 'main' && + github.repository == 'StarRocks/starrocks' env: PR_NUMBER: ${{ github.event.number }} steps: diff --git a/.github/workflows/ci-pipeline-branch.yml b/.github/workflows/ci-pipeline-branch.yml index 690d46e2aeae1..4c1a054d2cfb4 100644 --- a/.github/workflows/ci-pipeline-branch.yml +++ b/.github/workflows/ci-pipeline-branch.yml @@ -17,16 +17,14 @@ concurrency: jobs: sync-checker: - runs-on: ubuntu-latest - 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-')) + runs-on: [ self-hosted, normal ] name: RUN CHECKER + env: + PR_NUMBER: ${{ github.event.number }} + outputs: + PASS: ${{ steps.check.outputs.pass }} + THIRDPARTY: ${{ steps.thirdparty-checker.outputs.thirdparty }} steps: - - run: echo "success" - - run: | - echo "${{ github.head_ref }}" - name: upload info env: PR_NUMBER: ${{ github.event.number }} @@ -34,12 +32,14 @@ jobs: echo $PR_NUMBER > pr_num.txt GITHUB_SHA=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.head.sha) echo ${GITHUB_SHA} > head_sha.txt + - name: Upload the PR number uses: actions/upload-artifact@v2 with: name: pr_num path: ./pr_num.txt retention-days: 1 + - name: Upload the PR HEAD REF uses: actions/upload-artifact@v2 with: @@ -47,10 +47,29 @@ jobs: path: ./head_sha.txt retention-days: 1 + - name: 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-')) + run: | + echo "pass=true" >> $GITHUB_OUTPUT + + - uses: dorny/paths-filter@v2 + id: thirdparty-checker + if: always() + with: + filters: | + thirdparty: + - 'thirdparty/**' + - 'docker/dockerfiles/dev-env/dev-env.Dockerfile' + be-checker: runs-on: ubuntu-latest needs: sync-checker name: BE FILTER + if: needs.sync-checker.outputs.PASS == 'true' || needs.sync-checker.outputs.THIRDPARTY == 'true' outputs: output1: ${{ steps.be-changes-info.outputs.be }} output2: ${{ steps.be-changes-info.outputs.thirdparty }} @@ -215,6 +234,7 @@ jobs: runs-on: ubuntu-latest needs: sync-checker name: FE FILTER + if: needs.sync-checker.outputs.PASS == 'true' || needs.sync-checker.outputs.THIRDPARTY == 'true' outputs: output1: ${{ steps.fe-changes-info.outputs.fe }} steps: diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 1951f4903be3e..379f2d6e18762 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -18,18 +18,16 @@ jobs: sync-checker: runs-on: [self-hosted, normal] - 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-')) 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 }} + THIRDPARTY: ${{ steps.thirdparty-checker.outputs.thirdparty }} steps: - - name: upload info env: PR_NUMBER: ${{ github.event.number }} @@ -71,10 +69,29 @@ jobs: run: | rm -rf ${{ github.workspace }}/* + - name: 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-')) + run: | + echo "pass=true" >> $GITHUB_OUTPUT + + - uses: dorny/paths-filter@v2 + id: thirdparty-checker + if: always() + with: + filters: | + thirdparty: + - 'thirdparty/**' + - 'docker/dockerfiles/dev-env/dev-env.Dockerfile' + be-checker: runs-on: ubuntu-latest needs: sync-checker name: BE FILTER + if: needs.sync-checker.outputs.PASS == 'true' || needs.sync-checker.outputs.THIRDPARTY == 'true' outputs: output1: ${{ steps.be-changes-info.outputs.be }} output2: ${{ steps.be-changes-info.outputs.thirdparty }} @@ -284,6 +301,7 @@ jobs: runs-on: ubuntu-latest needs: sync-checker name: FE FILTER + if: needs.sync-checker.outputs.PASS == 'true' || needs.sync-checker.outputs.THIRDPARTY == 'true' outputs: output1: ${{ steps.fe-changes-info.outputs.fe }} steps: