Skip to content

Commit

Permalink
[Tool] Update thirdparty for sync pr (#28099)
Browse files Browse the repository at this point in the history
Signed-off-by: AndyZiYe <[email protected]>
  • Loading branch information
andyziye authored Jul 27, 2023
1 parent a0b2934 commit 21ffb75
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 14 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci-merged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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') ||
Expand Down Expand Up @@ -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:
Expand Down
36 changes: 28 additions & 8 deletions .github/workflows/ci-pipeline-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,40 +17,59 @@ 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 }}
run: |
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:
name: head_sha
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 }}
Expand Down Expand Up @@ -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:
Expand Down
28 changes: 23 additions & 5 deletions .github/workflows/ci-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 21ffb75

Please sign in to comment.