From 2fc5b83d5c57dc1a3d4b8d215b27a6759c5d6596 Mon Sep 17 00:00:00 2001 From: Xuchun Shang Date: Tue, 25 Nov 2025 18:39:05 +0800 Subject: [PATCH 1/3] Update CI Signed-off-by: Xuchun Shang --- .github/labeler.yml | 4 ++++ .github/workflows/ci.yml | 48 ++++++++++++++-------------------------- 2 files changed, 20 insertions(+), 32 deletions(-) create mode 100644 .github/labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 000000000..c1fd72772 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,4 @@ +run-ci: + - changed-files: + - any-glob-to-any-file: + - '**/*' \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5eb521b55..f014dc3dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,23 +7,23 @@ on: branches: [ "main" ] types: [opened, synchronize, reopened, labeled] +permissions: + contents: read + pull-requests: write + jobs: - init-label: - if: github.event.action == 'opened' + label: runs-on: ubuntu-latest - permissions: - pull-requests: write steps: - - name: Add run-ci label - env: - GH_TOKEN: ${{ github.token }} - run: gh pr edit ${{ github.event.pull_request.number }} --add-label "run-ci" + - name: Auto-label by file changes + uses: actions/labeler@v5 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + configuration-path: .github/labeler.yml + sync-labels: false build: - if: >- - github.event_name == 'push' || - github.event.action == 'opened' || - contains(github.event.pull_request.labels.*.name, 'run-ci') + if: contains(github.event.pull_request.labels.*.name, 'run-ci') runs-on: ubuntu-22.04 strategy: matrix: @@ -206,10 +206,6 @@ jobs: test-sglang-integration: needs: build-flags - if: >- - github.event_name == 'push' || - github.event.action == 'opened' || - contains(github.event.pull_request.labels.*.name, 'run-ci') runs-on: ubuntu-latest env: tone_user_name: ${{ secrets.TONE_USER_NAME }} @@ -265,10 +261,7 @@ jobs: shell: bash build-flags: - if: >- - github.event_name == 'push' || - github.event.action == 'opened' || - contains(github.event.pull_request.labels.*.name, 'run-ci') + if: contains(github.event.pull_request.labels.*.name, 'run-ci') runs-on: ubuntu-22.04 strategy: matrix: @@ -411,10 +404,7 @@ jobs: build-docker: name: Build Docker Image - if: >- - github.event_name == 'push' || - github.event.action == 'opened' || - contains(github.event.pull_request.labels.*.name, 'run-ci') + if: contains(github.event.pull_request.labels.*.name, 'run-ci') runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -427,10 +417,7 @@ jobs: spell-check: name: Spell Check with Typos - if: >- - github.event_name == 'push' || - github.event.action == 'opened' || - contains(github.event.pull_request.labels.*.name, 'run-ci') + if: contains(github.event.pull_request.labels.*.name, 'run-ci') runs-on: ubuntu-22.04 steps: - name: Checkout Actions Repository @@ -440,10 +427,7 @@ jobs: clang-format: name: Check code format - if: >- - github.event_name == 'push' || - github.event.action == 'opened' || - contains(github.event.pull_request.labels.*.name, 'run-ci') + if: contains(github.event.pull_request.labels.*.name, 'run-ci') runs-on: ubuntu-22.04 steps: - name: Checkout Actions Repository From abcd987b3ab51d9bb5effb6b3f11395469eacfba Mon Sep 17 00:00:00 2001 From: Xuchun Shang Date: Tue, 25 Nov 2025 18:44:21 +0800 Subject: [PATCH 2/3] fix Signed-off-by: Xuchun Shang --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f014dc3dd..0be280705 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,9 @@ permissions: jobs: label: runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write steps: - name: Auto-label by file changes uses: actions/labeler@v5 From b8bf830588bb4dbb6f04905ee2b9473b4226d149 Mon Sep 17 00:00:00 2001 From: Xuchun Shang Date: Tue, 25 Nov 2025 18:54:44 +0800 Subject: [PATCH 3/3] fix Signed-off-by: Xuchun Shang --- .github/workflows/ci.yml | 36 +++++++++++++++-------------------- .github/workflows/labeler.yml | 21 ++++++++++++++++++++ 2 files changed, 36 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/labeler.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0be280705..6f86c51a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,26 +7,12 @@ on: branches: [ "main" ] types: [opened, synchronize, reopened, labeled] -permissions: - contents: read - pull-requests: write jobs: - label: - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write - steps: - - name: Auto-label by file changes - uses: actions/labeler@v5 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" - configuration-path: .github/labeler.yml - sync-labels: false - build: - if: contains(github.event.pull_request.labels.*.name, 'run-ci') + if: >- + github.event.action == 'opened' || + contains(github.event.pull_request.labels.*.name, 'run-ci') runs-on: ubuntu-22.04 strategy: matrix: @@ -264,7 +250,9 @@ jobs: shell: bash build-flags: - if: contains(github.event.pull_request.labels.*.name, 'run-ci') + if: >- + github.event.action == 'opened' || + contains(github.event.pull_request.labels.*.name, 'run-ci') runs-on: ubuntu-22.04 strategy: matrix: @@ -407,7 +395,9 @@ jobs: build-docker: name: Build Docker Image - if: contains(github.event.pull_request.labels.*.name, 'run-ci') + if: >- + github.event.action == 'opened' || + contains(github.event.pull_request.labels.*.name, 'run-ci') runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -420,7 +410,9 @@ jobs: spell-check: name: Spell Check with Typos - if: contains(github.event.pull_request.labels.*.name, 'run-ci') + if: >- + github.event.action == 'opened' || + contains(github.event.pull_request.labels.*.name, 'run-ci') runs-on: ubuntu-22.04 steps: - name: Checkout Actions Repository @@ -430,7 +422,9 @@ jobs: clang-format: name: Check code format - if: contains(github.event.pull_request.labels.*.name, 'run-ci') + if: >- + github.event.action == 'opened' || + contains(github.event.pull_request.labels.*.name, 'run-ci') runs-on: ubuntu-22.04 steps: - name: Checkout Actions Repository diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 000000000..059fc4aae --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,21 @@ +name: Auto Label PRs + +on: + pull_request_target: + types: [opened, synchronize, reopened] + +permissions: + contents: read + pull-requests: write + +jobs: + triage: + runs-on: ubuntu-latest + steps: + - name: Auto-label + uses: actions/labeler@v5 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + configuration-path: .github/labeler.yml + sync-labels: false + dot: true \ No newline at end of file