From 0081b6f554af9205649eb84bb6fcc0ec9a5320ca Mon Sep 17 00:00:00 2001 From: Zhonghu Xu Date: Thu, 25 Jun 2026 11:59:58 +0800 Subject: [PATCH 1/6] Add trigger for release branch Signed-off-by: Zhonghu Xu --- .github/workflows/build-push-release.yml | 29 +++++++------- .github/workflows/codespell.yaml | 1 + .github/workflows/docs-tests.yml | 13 +++--- .github/workflows/e2e-tests.yml | 50 ++++++++++++++++++------ .github/workflows/go-check.yml | 1 + .github/workflows/go-tests.yml | 9 +++-- .github/workflows/python-lint.yml | 2 +- .github/workflows/python-tests.yml | 1 + 8 files changed, 68 insertions(+), 38 deletions(-) diff --git a/.github/workflows/build-push-release.yml b/.github/workflows/build-push-release.yml index 01645e70a..2bb92516c 100644 --- a/.github/workflows/build-push-release.yml +++ b/.github/workflows/build-push-release.yml @@ -8,20 +8,21 @@ on: - "v*.*.*" - "v*.*.*-*" # Support for pre-release tags like v1.2.3-alpha paths: - - 'charts/kthena/**' - - 'python/**' - - 'docker/**' - - '**.go' - - 'pkg/**' - - 'cmd/**' - - 'go.mod' - - 'go.sum' + - "charts/kthena/**" + - "python/**" + - "docker/**" + - "**.go" + - "pkg/**" + - "cmd/**" + - "go.mod" + - "go.sum" pull_request: branches: - main + - "release-**" paths: - "docker/**" - - 'python/Dockerfile' + - "python/Dockerfile" jobs: setup: @@ -165,7 +166,7 @@ jobs: # merge images: Create Multi-Arch Manifests merge_images: - needs: [ setup, build_images ] + needs: [setup, build_images] runs-on: ubuntu-latest if: ${{ github.event_name != 'pull_request' }} strategy: @@ -252,7 +253,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version-file: 'go.mod' + go-version-file: "go.mod" - name: Build binary env: @@ -286,7 +287,7 @@ jobs: retention-days: 1 push_helm_chart: - needs: [ setup, merge_images ] + needs: [setup, merge_images] runs-on: ubuntu-latest permissions: packages: write @@ -347,7 +348,7 @@ jobs: ./kthena-install.yaml create_github_release: - needs: [ setup, push_helm_chart, build_cli ] + needs: [setup, push_helm_chart, build_cli] if: needs.setup.outputs.is_tag == 'true' permissions: contents: write @@ -377,7 +378,7 @@ jobs: - **CLI Binaries**: Pre-built binaries for Linux (amd64/arm64), macOS (amd64/arm64), and Windows (amd64) ### Documentation - + - [Installation](https://kthena.volcano.sh/docs/getting-started/installation) - [Quick Start](https://kthena.volcano.sh/docs/getting-started/quick-start) - [Helm Chart Values](https://kthena.volcano.sh/docs/reference/helm-chart-values) diff --git a/.github/workflows/codespell.yaml b/.github/workflows/codespell.yaml index ce8ca3325..298c358a7 100644 --- a/.github/workflows/codespell.yaml +++ b/.github/workflows/codespell.yaml @@ -6,6 +6,7 @@ on: pull_request: branches: - main + - "release-**" permissions: contents: read diff --git a/.github/workflows/docs-tests.yml b/.github/workflows/docs-tests.yml index 6361d0740..64199da37 100644 --- a/.github/workflows/docs-tests.yml +++ b/.github/workflows/docs-tests.yml @@ -4,13 +4,14 @@ on: pull_request: branches: - main + - "release-**" paths: - - 'docs/kthena/**' + - "docs/kthena/**" push: branches: - main paths: - - 'docs/kthena/**' + - "docs/kthena/**" jobs: docs_test: @@ -21,11 +22,11 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '24.5.0' - cache: 'npm' - cache-dependency-path: './docs/kthena/package-lock.json' + node-version: "24.5.0" + cache: "npm" + cache-dependency-path: "./docs/kthena/package-lock.json" - name: Install dependencies working-directory: ./docs/kthena run: npm ci - name: Run documentation tests - run: make test-docs \ No newline at end of file + run: make test-docs diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 7f5cd4073..6ff7268cb 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -5,22 +5,46 @@ on: pull_request: branches: - main - paths: - - "pkg/**" - - "cmd/**" - - "test/**" - - "config/**" - - "charts/**" - - "docker/**" - - "hack/**" - - "go.mod" - - "go.sum" - - "Makefile" - - ".github/workflows/e2e-tests.yml" + - "release-**" + +permissions: + contents: read + pull-requests: read jobs: + changes: + name: Check E2E related changes + runs-on: ubuntu-latest + outputs: + e2e: ${{ steps.filter.outputs.e2e }} + steps: + - name: Check E2E related changes + id: filter + if: github.event_name == 'pull_request' + uses: dorny/paths-filter@v4 + with: + filters: | + e2e: + - "pkg/**" + - "cmd/**" + - "test/**" + - "config/**" + - "charts/**" + - "docker/**" + - "hack/**" + - "go.mod" + - "go.sum" + - "Makefile" + - ".github/workflows/e2e-tests.yml" + + - name: Skip E2E Tests + if: github.event_name != 'workflow_dispatch' && steps.filter.outputs.e2e != 'true' + run: echo "No E2E-related files changed; marking required check as passed." + e2e-tests: name: E2E (${{ matrix.category }}) + needs: changes + if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.e2e == 'true' runs-on: ubuntu-latest timeout-minutes: 30 strategy: @@ -49,7 +73,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v6 with: - go-version-file: 'go.mod' + go-version-file: "go.mod" - name: Install helm shell: bash diff --git a/.github/workflows/go-check.yml b/.github/workflows/go-check.yml index ff249b5d9..bc1aaf91f 100644 --- a/.github/workflows/go-check.yml +++ b/.github/workflows/go-check.yml @@ -4,6 +4,7 @@ on: pull_request: branches: - main + - "release-**" paths-ignore: - "**.md" - "**.svg" diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index 7030a75de..1962c9aaa 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -3,8 +3,9 @@ on: pull_request: branches: - main + - "release-**" paths: - - '**.go' + - "**.go" - "pkg/**" - "cmd/**" - "go.mod" @@ -14,7 +15,7 @@ on: branches: - main paths: - - '**.go' + - "**.go" - "pkg/**" - "cmd/**" - "go.mod" @@ -29,7 +30,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version-file: 'go.mod' # Automatically set Go version from go.mod + go-version-file: "go.mod" # Automatically set Go version from go.mod - name: Run Unit Tests run: make test - name: Calculate coverage percentage @@ -47,4 +48,4 @@ jobs: exit 1 else echo "Code coverage ($CURRENT_COVERAGE%) meets or exceeds the required threshold of $THRESHOLD%." - fi \ No newline at end of file + fi diff --git a/.github/workflows/python-lint.yml b/.github/workflows/python-lint.yml index 2e5d265f5..c4bd64672 100644 --- a/.github/workflows/python-lint.yml +++ b/.github/workflows/python-lint.yml @@ -4,7 +4,7 @@ on: pull_request: branches: - main - - release + - "release-**" paths: - "python/**" - "**.py" diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 2c6466188..134b26745 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -4,6 +4,7 @@ on: pull_request: branches: - main + - "release-**" paths: - "python/**" - "**.py" From 502796dac35cebcb9981ae2e0d9fe468913df6e3 Mon Sep 17 00:00:00 2001 From: Zhonghu Xu Date: Thu, 25 Jun 2026 14:52:35 +0800 Subject: [PATCH 2/6] Address comment to Signed-off-by: Zhonghu Xu --- .github/workflows/approve-workflow.yml | 2 +- .github/workflows/build-push-release.yml | 2 +- .github/workflows/codespell.yaml | 2 +- .github/workflows/docs-tests.yml | 2 +- .github/workflows/e2e-tests.yml | 2 +- .github/workflows/go-check.yml | 2 +- .github/workflows/go-tests.yml | 2 +- .github/workflows/python-lint.yml | 2 +- .github/workflows/python-tests.yml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/approve-workflow.yml b/.github/workflows/approve-workflow.yml index 142a1caf4..d661f614b 100644 --- a/.github/workflows/approve-workflow.yml +++ b/.github/workflows/approve-workflow.yml @@ -7,7 +7,7 @@ on: - synchronize branches: - main - - "release-**" + - "release-*" permissions: contents: read diff --git a/.github/workflows/build-push-release.yml b/.github/workflows/build-push-release.yml index 2bb92516c..7af270f14 100644 --- a/.github/workflows/build-push-release.yml +++ b/.github/workflows/build-push-release.yml @@ -19,7 +19,7 @@ on: pull_request: branches: - main - - "release-**" + - "release-*" paths: - "docker/**" - "python/Dockerfile" diff --git a/.github/workflows/codespell.yaml b/.github/workflows/codespell.yaml index 298c358a7..e6a0cf190 100644 --- a/.github/workflows/codespell.yaml +++ b/.github/workflows/codespell.yaml @@ -6,7 +6,7 @@ on: pull_request: branches: - main - - "release-**" + - "release-*" permissions: contents: read diff --git a/.github/workflows/docs-tests.yml b/.github/workflows/docs-tests.yml index 64199da37..8562f312e 100644 --- a/.github/workflows/docs-tests.yml +++ b/.github/workflows/docs-tests.yml @@ -4,7 +4,7 @@ on: pull_request: branches: - main - - "release-**" + - "release-*" paths: - "docs/kthena/**" push: diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 6ff7268cb..14f97b9f8 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -5,7 +5,7 @@ on: pull_request: branches: - main - - "release-**" + - "release-*" permissions: contents: read diff --git a/.github/workflows/go-check.yml b/.github/workflows/go-check.yml index bc1aaf91f..ef8c6921a 100644 --- a/.github/workflows/go-check.yml +++ b/.github/workflows/go-check.yml @@ -4,7 +4,7 @@ on: pull_request: branches: - main - - "release-**" + - "release-*" paths-ignore: - "**.md" - "**.svg" diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index 1962c9aaa..ac6dc35a2 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -3,7 +3,7 @@ on: pull_request: branches: - main - - "release-**" + - "release-*" paths: - "**.go" - "pkg/**" diff --git a/.github/workflows/python-lint.yml b/.github/workflows/python-lint.yml index c4bd64672..183e75294 100644 --- a/.github/workflows/python-lint.yml +++ b/.github/workflows/python-lint.yml @@ -4,7 +4,7 @@ on: pull_request: branches: - main - - "release-**" + - "release-*" paths: - "python/**" - "**.py" diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 134b26745..73dc39790 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -4,7 +4,7 @@ on: pull_request: branches: - main - - "release-**" + - "release-*" paths: - "python/**" - "**.py" From 9488d77730ee733950ab799c7336445c42c9d96b Mon Sep 17 00:00:00 2001 From: Zhonghu Xu Date: Thu, 25 Jun 2026 15:31:41 +0800 Subject: [PATCH 3/6] Run workflow and do path filter innerly Signed-off-by: Zhonghu Xu --- .github/workflows/build-push-release.yml | 37 ++++++++++++++++-- .github/workflows/codespell.yaml | 2 - .github/workflows/docs-tests.yml | 32 ++++++++++++---- .github/workflows/go-check.yml | 43 +++++++++++++++------ .github/workflows/go-tests.yml | 44 ++++++++++++++-------- .github/workflows/licenses-lint.yaml | 38 +++++++++++++++---- .github/workflows/python-licenses-lint.yml | 31 +++++++++++++-- .github/workflows/python-lint.yml | 38 ++++++++++++++----- .github/workflows/python-tests.yml | 35 +++++++++++++---- 9 files changed, 233 insertions(+), 67 deletions(-) diff --git a/.github/workflows/build-push-release.yml b/.github/workflows/build-push-release.yml index 7af270f14..3210f4607 100644 --- a/.github/workflows/build-push-release.yml +++ b/.github/workflows/build-push-release.yml @@ -20,12 +20,36 @@ on: branches: - main - "release-*" - paths: - - "docker/**" - - "python/Dockerfile" + +permissions: + contents: read + pull-requests: read jobs: + changes: + name: Check whether pull request need build + runs-on: ubuntu-latest + outputs: + release_build: ${{ steps.filter.outputs.release_build }} + steps: + - name: Check build related changes + id: filter + if: github.event_name == 'pull_request' + uses: dorny/paths-filter@v4 + with: + filters: | + release_build: + - "docker/**" + - "python/Dockerfile" + - ".github/workflows/build-push-release.yml" + + - name: Skip build + if: github.event_name == 'pull_request' && steps.filter.outputs.release_build != 'true' + run: echo "No release build-related files changed; marking required check as passed." + setup: + needs: changes + if: github.event_name != 'pull_request' || needs.changes.outputs.release_build == 'true' runs-on: ubuntu-latest outputs: version: ${{ steps.version.outputs.version }} @@ -62,6 +86,9 @@ jobs: build_images: needs: setup runs-on: ${{ matrix.os }} + permissions: + contents: read + packages: write strategy: matrix: include: @@ -169,6 +196,9 @@ jobs: needs: [setup, build_images] runs-on: ubuntu-latest if: ${{ github.event_name != 'pull_request' }} + permissions: + contents: read + packages: write strategy: matrix: include: @@ -290,6 +320,7 @@ jobs: needs: [setup, merge_images] runs-on: ubuntu-latest permissions: + contents: read packages: write steps: - name: Checkout diff --git a/.github/workflows/codespell.yaml b/.github/workflows/codespell.yaml index e6a0cf190..c2d5da43a 100644 --- a/.github/workflows/codespell.yaml +++ b/.github/workflows/codespell.yaml @@ -1,8 +1,6 @@ name: Codespell on: - push: - branches: [main] pull_request: branches: - main diff --git a/.github/workflows/docs-tests.yml b/.github/workflows/docs-tests.yml index 8562f312e..38d796684 100644 --- a/.github/workflows/docs-tests.yml +++ b/.github/workflows/docs-tests.yml @@ -5,17 +5,35 @@ on: branches: - main - "release-*" - paths: - - "docs/kthena/**" - push: - branches: - - main - paths: - - "docs/kthena/**" +permissions: + contents: read + pull-requests: read jobs: + changes: + name: Check Documentation related changes + runs-on: ubuntu-latest + outputs: + docs: ${{ steps.filter.outputs.docs }} + steps: + - name: Check Documentation related changes + id: filter + if: github.event_name == 'pull_request' + uses: dorny/paths-filter@v4 + with: + filters: | + docs: + - "docs/kthena/**" + - ".github/workflows/docs-tests.yml" + + - name: Skip Documentation tests + if: steps.filter.outputs.docs != 'true' + run: echo "No documentation-related files changed; marking required check as passed." + docs_test: name: Docusaurus tests + needs: changes + if: needs.changes.outputs.docs == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/go-check.yml b/.github/workflows/go-check.yml index ef8c6921a..39a97ff59 100644 --- a/.github/workflows/go-check.yml +++ b/.github/workflows/go-check.yml @@ -5,21 +5,40 @@ on: branches: - main - "release-*" - paths-ignore: - - "**.md" - - "**.svg" - - "**.png" - - "docs/**" - - ".github/**" - push: - branches: - - main - paths-ignore: - - "docs/**" - - ".github/**" + +permissions: + contents: read + pull-requests: read jobs: + changes: + name: Check Go check related changes + runs-on: ubuntu-latest + outputs: + go_check: ${{ steps.filter.outputs.go_check }} + steps: + - name: Check Go check related changes + id: filter + if: github.event_name == 'pull_request' + uses: dorny/paths-filter@v4 + with: + predicate-quantifier: every + filters: | + go_check: + - "**" + - "!**.md" + - "!**.svg" + - "!**.png" + - "!docs/**" + - "!.github/**" + + - name: Skip Go check + if: steps.filter.outputs.go_check != 'true' + run: echo "No Go check-related files changed; marking required check as passed." + build: + needs: changes + if: needs.changes.outputs.go_check == 'true' runs-on: ubuntu-22.04 steps: diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index ac6dc35a2..83f549147 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -4,26 +4,40 @@ on: branches: - main - "release-*" - paths: - - "**.go" - - "pkg/**" - - "cmd/**" - - "go.mod" - - "go.sum" - push: - branches: - - main - paths: - - "**.go" - - "pkg/**" - - "cmd/**" - - "go.mod" - - "go.sum" +permissions: + contents: read + pull-requests: read jobs: + changes: + name: Check Go test related changes + runs-on: ubuntu-latest + outputs: + go: ${{ steps.filter.outputs.go }} + steps: + - name: Check Go test related changes + id: filter + if: github.event_name == 'pull_request' + uses: dorny/paths-filter@v4 + with: + filters: | + go: + - "**.go" + - "pkg/**" + - "cmd/**" + - "go.mod" + - "go.sum" + - ".github/workflows/go-tests.yml" + + - name: Skip Go tests + if: steps.filter.outputs.go != 'true' + run: echo "No Go test-related files changed; marking required check as passed." + go_unit_test: name: Go tests + needs: changes + if: needs.changes.outputs.go == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/licenses-lint.yaml b/.github/workflows/licenses-lint.yaml index 43f606281..30e6327ac 100644 --- a/.github/workflows/licenses-lint.yaml +++ b/.github/workflows/licenses-lint.yaml @@ -5,17 +5,41 @@ on: branches: - main - release-* - paths-ignore: - - "docs/**" - - "LICENSE" - - "OWNERS" - - "*.md" - - "python/**" +permissions: + contents: read + pull-requests: read jobs: + changes: + name: Check license lint related changes + runs-on: ubuntu-latest + outputs: + licenses: ${{ steps.filter.outputs.licenses }} + steps: + - name: Check license lint related changes + id: filter + if: github.event_name == 'pull_request' + uses: dorny/paths-filter@v4 + with: + predicate-quantifier: every + filters: | + licenses: + - "**" + - "!docs/**" + - "!LICENSE" + - "!OWNERS" + - "!*.md" + - "!python/**" + + - name: Skip Licenses Lint + if: steps.filter.outputs.licenses != 'true' + run: echo "No license lint-related files changed; marking required check as passed." + licenses-lint: name: Licenses Lint + needs: changes + if: needs.changes.outputs.licenses == 'true' timeout-minutes: 40 runs-on: ubuntu-24.04 steps: @@ -24,7 +48,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version-file: 'go.mod' + go-version-file: "go.mod" - name: generate license mirror run: | make licenses-check diff --git a/.github/workflows/python-licenses-lint.yml b/.github/workflows/python-licenses-lint.yml index 1893cb2f4..b07e13c2b 100644 --- a/.github/workflows/python-licenses-lint.yml +++ b/.github/workflows/python-licenses-lint.yml @@ -5,12 +5,37 @@ on: branches: - main - release-* - paths: - - "python/**" + +permissions: + contents: read + pull-requests: read jobs: + changes: + name: Check Python license related changes + runs-on: ubuntu-latest + outputs: + python: ${{ steps.filter.outputs.python }} + steps: + - name: Check Python license related changes + id: filter + if: github.event_name == 'pull_request' + uses: dorny/paths-filter@v4 + with: + filters: | + python: + - "python/**" + - "config/python-licenses-lint.ini" + - ".github/workflows/python-licenses-lint.yml" + + - name: Skip Python Licenses Lint + if: steps.filter.outputs.python != 'true' + run: echo "No Python license-related files changed; marking required check as passed." + python-licenses-lint: name: Python Licenses Lint + needs: changes + if: needs.changes.outputs.python == 'true' timeout-minutes: 40 runs-on: ubuntu-latest steps: @@ -19,7 +44,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.11' + python-version: "3.11" - name: Install liccheck run: | python -m pip install --upgrade pip diff --git a/.github/workflows/python-lint.yml b/.github/workflows/python-lint.yml index 183e75294..630fb3bcc 100644 --- a/.github/workflows/python-lint.yml +++ b/.github/workflows/python-lint.yml @@ -5,20 +5,38 @@ on: branches: - main - "release-*" - paths: - - "python/**" - - "**.py" - - "python/kthena/pyproject.toml" - push: - branches: - - main - paths: - - "python/**" - - "python/kthena/pyproject.toml" + +permissions: + contents: read + pull-requests: read jobs: + changes: + name: Check Python lint related changes + runs-on: ubuntu-latest + outputs: + python: ${{ steps.filter.outputs.python }} + steps: + - name: Check Python lint related changes + id: filter + if: github.event_name == 'pull_request' + uses: dorny/paths-filter@v4 + with: + filters: | + python: + - "python/**" + - "**.py" + - "python/kthena/pyproject.toml" + - ".github/workflows/python-lint.yml" + + - name: Skip Python lint + if: steps.filter.outputs.python != 'true' + run: echo "No Python lint-related files changed; marking required check as passed." + python_lint: name: Python Lint + needs: changes + if: needs.changes.outputs.python == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 73dc39790..5d7b1be38 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -5,18 +5,37 @@ on: branches: - main - "release-*" - paths: - - "python/**" - - "**.py" - push: - branches: - - main - paths: - - "python/**" + +permissions: + contents: read + pull-requests: read jobs: + changes: + name: Check Python test related changes + runs-on: ubuntu-latest + outputs: + python: ${{ steps.filter.outputs.python }} + steps: + - name: Check Python test related changes + id: filter + if: github.event_name == 'pull_request' + uses: dorny/paths-filter@v4 + with: + filters: | + python: + - "python/**" + - "**.py" + - ".github/workflows/python-tests.yml" + + - name: Skip Python tests + if: steps.filter.outputs.python != 'true' + run: echo "No Python test-related files changed; marking required check as passed." + python_unit_test: name: Python tests + needs: changes + if: needs.changes.outputs.python == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From c741998fc317e74a49dfbaf6f385d8d97ba1a36b Mon Sep 17 00:00:00 2001 From: Zhonghu Xu Date: Thu, 25 Jun 2026 16:43:03 +0800 Subject: [PATCH 4/6] Update Signed-off-by: Zhonghu Xu --- .github/workflows/build-push-release.yml | 27 +++++++------- .github/workflows/docs-tests.yml | 16 ++++----- .github/workflows/e2e-tests.yml | 42 +++++++++++----------- .github/workflows/go-check.yml | 20 +++++------ .github/workflows/go-tests.yml | 17 ++++----- .github/workflows/licenses-lint.yaml | 20 +++++------ .github/workflows/python-licenses-lint.yml | 19 +++++----- .github/workflows/python-lint.yml | 15 +++----- .github/workflows/python-tests.yml | 17 ++++----- 9 files changed, 85 insertions(+), 108 deletions(-) diff --git a/.github/workflows/build-push-release.yml b/.github/workflows/build-push-release.yml index 3210f4607..e56d58f26 100644 --- a/.github/workflows/build-push-release.yml +++ b/.github/workflows/build-push-release.yml @@ -26,11 +26,13 @@ permissions: pull-requests: read jobs: - changes: - name: Check whether pull request need build + setup: runs-on: ubuntu-latest outputs: release_build: ${{ steps.filter.outputs.release_build }} + version: ${{ steps.version.outputs.version }} + is_tag: ${{ steps.version.outputs.is_tag }} + prerelease: ${{ steps.is_prerelease.outputs.prerelease }} steps: - name: Check build related changes id: filter @@ -47,21 +49,14 @@ jobs: if: github.event_name == 'pull_request' && steps.filter.outputs.release_build != 'true' run: echo "No release build-related files changed; marking required check as passed." - setup: - needs: changes - if: github.event_name != 'pull_request' || needs.changes.outputs.release_build == 'true' - runs-on: ubuntu-latest - outputs: - version: ${{ steps.version.outputs.version }} - is_tag: ${{ steps.version.outputs.is_tag }} - prerelease: ${{ steps.is_prerelease.outputs.prerelease }} - steps: - name: Checkout + if: github.event_name != 'pull_request' || steps.filter.outputs.release_build == 'true' uses: actions/checkout@v5 with: fetch-depth: 0 - name: Determine Version + if: github.event_name != 'pull_request' || steps.filter.outputs.release_build == 'true' id: version run: | if [[ "$GITHUB_REF" == refs/tags/v* ]]; then @@ -74,7 +69,7 @@ jobs: echo "version=$VERSION" >> $GITHUB_OUTPUT - name: Check for Prerelease - if: steps.version.outputs.is_tag == 'true' + if: steps.version.outputs.is_tag == 'true' && (github.event_name != 'pull_request' || steps.filter.outputs.release_build == 'true') id: is_prerelease run: | if [[ "${{ steps.version.outputs.version }}" == *-* ]]; then @@ -142,6 +137,7 @@ jobs: platform: linux/arm64 steps: - name: Checkout + if: github.event_name != 'pull_request' || needs.setup.outputs.release_build == 'true' uses: actions/checkout@v5 - name: Login to GitHub Container Registry @@ -153,6 +149,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Docker Image Metadata + if: github.event_name != 'pull_request' || needs.setup.outputs.release_build == 'true' id: meta uses: docker/metadata-action@v5 with: @@ -162,9 +159,11 @@ jobs: type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} - name: Set up Docker Buildx + if: github.event_name != 'pull_request' || needs.setup.outputs.release_build == 'true' uses: docker/setup-buildx-action@v3 - name: Build and Push Docker Images + if: github.event_name != 'pull_request' || needs.setup.outputs.release_build == 'true' uses: docker/build-push-action@v6 id: build with: @@ -278,14 +277,17 @@ jobs: ext: ".exe" steps: - name: Checkout + if: github.event_name != 'pull_request' || needs.setup.outputs.release_build == 'true' uses: actions/checkout@v5 - name: Set up Go + if: github.event_name != 'pull_request' || needs.setup.outputs.release_build == 'true' uses: actions/setup-go@v5 with: go-version-file: "go.mod" - name: Build binary + if: github.event_name != 'pull_request' || needs.setup.outputs.release_build == 'true' env: GOOS: ${{ matrix.goos }} GOARCH: ${{ matrix.goarch }} @@ -294,6 +296,7 @@ jobs: go build -o kthena${{ matrix.ext }} ./cli/kthena - name: Package binary + if: github.event_name != 'pull_request' || needs.setup.outputs.release_build == 'true' run: | VERSION="${{ needs.setup.outputs.version }}" OS="${{ matrix.os }}" diff --git a/.github/workflows/docs-tests.yml b/.github/workflows/docs-tests.yml index 38d796684..6fa3a15ad 100644 --- a/.github/workflows/docs-tests.yml +++ b/.github/workflows/docs-tests.yml @@ -10,11 +10,9 @@ permissions: pull-requests: read jobs: - changes: - name: Check Documentation related changes + docs_test: + name: Docusaurus tests runs-on: ubuntu-latest - outputs: - docs: ${{ steps.filter.outputs.docs }} steps: - name: Check Documentation related changes id: filter @@ -30,21 +28,19 @@ jobs: if: steps.filter.outputs.docs != 'true' run: echo "No documentation-related files changed; marking required check as passed." - docs_test: - name: Docusaurus tests - needs: changes - if: needs.changes.outputs.docs == 'true' - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 + if: steps.filter.outputs.docs == 'true' - name: Setup Node.js + if: steps.filter.outputs.docs == 'true' uses: actions/setup-node@v4 with: node-version: "24.5.0" cache: "npm" cache-dependency-path: "./docs/kthena/package-lock.json" - name: Install dependencies + if: steps.filter.outputs.docs == 'true' working-directory: ./docs/kthena run: npm ci - name: Run documentation tests + if: steps.filter.outputs.docs == 'true' run: make test-docs diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 14f97b9f8..e61022fa2 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -12,11 +12,18 @@ permissions: pull-requests: read jobs: - changes: - name: Check E2E related changes + e2e-tests: + name: E2E (${{ matrix.category }}) runs-on: ubuntu-latest - outputs: - e2e: ${{ steps.filter.outputs.e2e }} + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + category: + - controller-manager + - router + - gateway-api + - gateway-inference-extension steps: - name: Check E2E related changes id: filter @@ -41,22 +48,8 @@ jobs: if: github.event_name != 'workflow_dispatch' && steps.filter.outputs.e2e != 'true' run: echo "No E2E-related files changed; marking required check as passed." - e2e-tests: - name: E2E (${{ matrix.category }}) - needs: changes - if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.e2e == 'true' - runs-on: ubuntu-latest - timeout-minutes: 30 - strategy: - fail-fast: false - matrix: - category: - - controller-manager - - router - - gateway-api - - gateway-inference-extension - steps: - name: Free Disk Space + if: github.event_name == 'workflow_dispatch' || steps.filter.outputs.e2e == 'true' uses: jlumbroso/free-disk-space@v1.3.1 with: tool-cache: false @@ -68,30 +61,35 @@ jobs: swap-storage: true - name: Checkout code + if: github.event_name == 'workflow_dispatch' || steps.filter.outputs.e2e == 'true' uses: actions/checkout@v6 - name: Setup Go + if: github.event_name == 'workflow_dispatch' || steps.filter.outputs.e2e == 'true' uses: actions/setup-go@v6 with: go-version-file: "go.mod" - name: Install helm + if: github.event_name == 'workflow_dispatch' || steps.filter.outputs.e2e == 'true' shell: bash run: | curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash - name: Create k8s Kind Cluster + if: github.event_name == 'workflow_dispatch' || steps.filter.outputs.e2e == 'true' uses: helm/kind-action@v1 with: install_only: true - name: Run E2E Tests (${{ matrix.category }}) + if: github.event_name == 'workflow_dispatch' || steps.filter.outputs.e2e == 'true' run: make test-e2e-${{ matrix.category }} env: CLUSTER_NAME: kthena-${{ matrix.category }} - name: Collect logs on failure - if: failure() + if: failure() && (github.event_name == 'workflow_dispatch' || steps.filter.outputs.e2e == 'true') run: | echo "=== Kind cluster logs for ${{ matrix.category }} ===" mkdir -p /tmp/kind-logs @@ -104,7 +102,7 @@ jobs: fi - name: Upload logs on failure - if: failure() + if: failure() && (github.event_name == 'workflow_dispatch' || steps.filter.outputs.e2e == 'true') uses: actions/upload-artifact@v4 with: name: e2e-logs-${{ matrix.category }}-${{ github.run_id }} @@ -113,7 +111,7 @@ jobs: if-no-files-found: warn - name: Cleanup E2E Environment - if: always() + if: always() && (github.event_name == 'workflow_dispatch' || steps.filter.outputs.e2e == 'true') run: make test-e2e-cleanup env: CLUSTER_NAME: kthena-${{ matrix.category }} diff --git a/.github/workflows/go-check.yml b/.github/workflows/go-check.yml index 39a97ff59..ef1bfba83 100644 --- a/.github/workflows/go-check.yml +++ b/.github/workflows/go-check.yml @@ -11,11 +11,9 @@ permissions: pull-requests: read jobs: - changes: - name: Check Go check related changes - runs-on: ubuntu-latest - outputs: - go_check: ${{ steps.filter.outputs.go_check }} + build: + runs-on: ubuntu-22.04 + steps: - name: Check Go check related changes id: filter @@ -36,30 +34,30 @@ jobs: if: steps.filter.outputs.go_check != 'true' run: echo "No Go check-related files changed; marking required check as passed." - build: - needs: changes - if: needs.changes.outputs.go_check == 'true' - runs-on: ubuntu-22.04 - - steps: - uses: actions/checkout@v4 + if: steps.filter.outputs.go_check == 'true' - name: install helm + if: steps.filter.outputs.go_check == 'true' shell: bash run: | curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash - name: helm lint + if: steps.filter.outputs.go_check == 'true' shell: bash run: | helm lint charts/kthena - name: Setup Go + if: steps.filter.outputs.go_check == 'true' uses: actions/setup-go@v6 with: go-version-file: "go.mod" - name: Build Kthena + if: steps.filter.outputs.go_check == 'true' shell: bash run: | make gen-check - name: golangci-lint + if: steps.filter.outputs.go_check == 'true' shell: bash run: | make lint diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index 83f549147..20d8959a5 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -10,11 +10,9 @@ permissions: pull-requests: read jobs: - changes: - name: Check Go test related changes + go_unit_test: + name: Go tests runs-on: ubuntu-latest - outputs: - go: ${{ steps.filter.outputs.go }} steps: - name: Check Go test related changes id: filter @@ -34,26 +32,25 @@ jobs: if: steps.filter.outputs.go != 'true' run: echo "No Go test-related files changed; marking required check as passed." - go_unit_test: - name: Go tests - needs: changes - if: needs.changes.outputs.go == 'true' - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 + if: steps.filter.outputs.go == 'true' - name: Setup Go + if: steps.filter.outputs.go == 'true' uses: actions/setup-go@v5 with: go-version-file: "go.mod" # Automatically set Go version from go.mod - name: Run Unit Tests + if: steps.filter.outputs.go == 'true' run: make test - name: Calculate coverage percentage + if: steps.filter.outputs.go == 'true' id: coverage run: | COVERAGE=$(go tool cover -func=cover.out | grep total | awk '{print $3}' | sed 's/\%//') echo "Current coverage: $COVERAGE%" echo "coverage_percentage=$COVERAGE" >> $GITHUB_OUTPUT - name: Check coverage threshold + if: steps.filter.outputs.go == 'true' run: | THRESHOLD=10 # Set coverage threshold CURRENT_COVERAGE=${{ steps.coverage.outputs.coverage_percentage }} diff --git a/.github/workflows/licenses-lint.yaml b/.github/workflows/licenses-lint.yaml index 30e6327ac..3347d597f 100644 --- a/.github/workflows/licenses-lint.yaml +++ b/.github/workflows/licenses-lint.yaml @@ -11,11 +11,10 @@ permissions: pull-requests: read jobs: - changes: - name: Check license lint related changes - runs-on: ubuntu-latest - outputs: - licenses: ${{ steps.filter.outputs.licenses }} + licenses-lint: + name: Licenses Lint + timeout-minutes: 40 + runs-on: ubuntu-24.04 steps: - name: Check license lint related changes id: filter @@ -36,23 +35,20 @@ jobs: if: steps.filter.outputs.licenses != 'true' run: echo "No license lint-related files changed; marking required check as passed." - licenses-lint: - name: Licenses Lint - needs: changes - if: needs.changes.outputs.licenses == 'true' - timeout-minutes: 40 - runs-on: ubuntu-24.04 - steps: - name: Checkout code + if: steps.filter.outputs.licenses == 'true' uses: actions/checkout@v3 - name: Install Go + if: steps.filter.outputs.licenses == 'true' uses: actions/setup-go@v5 with: go-version-file: "go.mod" - name: generate license mirror + if: steps.filter.outputs.licenses == 'true' run: | make licenses-check - name: lint-licenses + if: steps.filter.outputs.licenses == 'true' # if restricted > 0, CI will report an error. run: | make lint-licenses diff --git a/.github/workflows/python-licenses-lint.yml b/.github/workflows/python-licenses-lint.yml index b07e13c2b..358d6da2d 100644 --- a/.github/workflows/python-licenses-lint.yml +++ b/.github/workflows/python-licenses-lint.yml @@ -11,11 +11,10 @@ permissions: pull-requests: read jobs: - changes: - name: Check Python license related changes + python-licenses-lint: + name: Python Licenses Lint + timeout-minutes: 40 runs-on: ubuntu-latest - outputs: - python: ${{ steps.filter.outputs.python }} steps: - name: Check Python license related changes id: filter @@ -32,24 +31,21 @@ jobs: if: steps.filter.outputs.python != 'true' run: echo "No Python license-related files changed; marking required check as passed." - python-licenses-lint: - name: Python Licenses Lint - needs: changes - if: needs.changes.outputs.python == 'true' - timeout-minutes: 40 - runs-on: ubuntu-latest - steps: - name: Checkout code + if: steps.filter.outputs.python == 'true' uses: actions/checkout@v3 - name: Set up Python + if: steps.filter.outputs.python == 'true' uses: actions/setup-python@v4 with: python-version: "3.11" - name: Install liccheck + if: steps.filter.outputs.python == 'true' run: | python -m pip install --upgrade pip pip install liccheck - name: Check Runtime Requirements + if: steps.filter.outputs.python == 'true' run: | if [ -f "python/kthena/runtime/requirements.txt" ]; then echo "🔍 Checking runtime requirements..." @@ -60,6 +56,7 @@ jobs: echo "⚠️ Runtime requirements file not found, skipping..." fi - name: Check Downloader Requirements + if: steps.filter.outputs.python == 'true' run: | if [ -f "python/kthena/downloader/requirements.txt" ]; then echo "🔍 Checking downloader requirements..." diff --git a/.github/workflows/python-lint.yml b/.github/workflows/python-lint.yml index 630fb3bcc..cf7b3c406 100644 --- a/.github/workflows/python-lint.yml +++ b/.github/workflows/python-lint.yml @@ -11,11 +11,9 @@ permissions: pull-requests: read jobs: - changes: - name: Check Python lint related changes + python_lint: + name: Python Lint runs-on: ubuntu-latest - outputs: - python: ${{ steps.filter.outputs.python }} steps: - name: Check Python lint related changes id: filter @@ -33,17 +31,14 @@ jobs: if: steps.filter.outputs.python != 'true' run: echo "No Python lint-related files changed; marking required check as passed." - python_lint: - name: Python Lint - needs: changes - if: needs.changes.outputs.python == 'true' - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 + if: steps.filter.outputs.python == 'true' - name: Set up Python + if: steps.filter.outputs.python == 'true' uses: actions/setup-python@v4 with: python-version: "3.10" - name: Run Lint + if: steps.filter.outputs.python == 'true' run: | make lint-python diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 5d7b1be38..402df8940 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -11,11 +11,9 @@ permissions: pull-requests: read jobs: - changes: - name: Check Python test related changes + python_unit_test: + name: Python tests runs-on: ubuntu-latest - outputs: - python: ${{ steps.filter.outputs.python }} steps: - name: Check Python test related changes id: filter @@ -32,27 +30,26 @@ jobs: if: steps.filter.outputs.python != 'true' run: echo "No Python test-related files changed; marking required check as passed." - python_unit_test: - name: Python tests - needs: changes - if: needs.changes.outputs.python == 'true' - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 + if: steps.filter.outputs.python == 'true' - name: Set up Python + if: steps.filter.outputs.python == 'true' uses: actions/setup-python@v4.0.0 with: python-version: "3.10" - name: Install dependencies + if: steps.filter.outputs.python == 'true' run: | python -m pip install --upgrade pip pip install -r python/kthena/downloader/requirements.txt pip install -r python/kthena/runtime/requirements.txt pip install -r python/kthena/runtime/requirements-dev.txt - name: Run tests + if: steps.filter.outputs.python == 'true' run: | pip install coverage coverage run -m pytest - name: Check coverage threshold + if: steps.filter.outputs.python == 'true' run: | coverage report --fail-under=60 # Set coverage threshold From 2bc56e6bf9d794aec909549014ef27cce81ce46d Mon Sep 17 00:00:00 2001 From: Zhonghu Xu Date: Tue, 7 Jul 2026 11:55:54 +0800 Subject: [PATCH 5/6] address comment Signed-off-by: Zhonghu Xu --- .github/workflows/licenses-lint.yaml | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/.github/workflows/licenses-lint.yaml b/.github/workflows/licenses-lint.yaml index 3347d597f..31d46009e 100644 --- a/.github/workflows/licenses-lint.yaml +++ b/.github/workflows/licenses-lint.yaml @@ -16,39 +16,16 @@ jobs: timeout-minutes: 40 runs-on: ubuntu-24.04 steps: - - name: Check license lint related changes - id: filter - if: github.event_name == 'pull_request' - uses: dorny/paths-filter@v4 - with: - predicate-quantifier: every - filters: | - licenses: - - "**" - - "!docs/**" - - "!LICENSE" - - "!OWNERS" - - "!*.md" - - "!python/**" - - - name: Skip Licenses Lint - if: steps.filter.outputs.licenses != 'true' - run: echo "No license lint-related files changed; marking required check as passed." - - name: Checkout code - if: steps.filter.outputs.licenses == 'true' uses: actions/checkout@v3 - name: Install Go - if: steps.filter.outputs.licenses == 'true' uses: actions/setup-go@v5 with: go-version-file: "go.mod" - name: generate license mirror - if: steps.filter.outputs.licenses == 'true' run: | make licenses-check - name: lint-licenses - if: steps.filter.outputs.licenses == 'true' # if restricted > 0, CI will report an error. run: | make lint-licenses From 7073259d5a235e4a477bce30e2d4910249138267 Mon Sep 17 00:00:00 2001 From: Zhonghu Xu Date: Tue, 7 Jul 2026 12:00:21 +0800 Subject: [PATCH 6/6] Fix build failure caused by other merged pr Signed-off-by: Zhonghu Xu --- pkg/kthena-router/controller/httproute_controller_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/kthena-router/controller/httproute_controller_test.go b/pkg/kthena-router/controller/httproute_controller_test.go index 4af0457a5..044594d67 100644 --- a/pkg/kthena-router/controller/httproute_controller_test.go +++ b/pkg/kthena-router/controller/httproute_controller_test.go @@ -424,7 +424,8 @@ func TestHTTPRouteController_SyncHandler_MovesRouteWithGatewayOnlyInInformer(t * _, err = gatewayClient.GatewayV1().HTTPRoutes(ns).Create(ctx, httpRoute, metav1.CreateOptions{}) assert.NoError(t, err) - ctrl := NewHTTPRouteController(gatewayInformerFactory, kubeInformerFactory, store) + ctrl, err := NewHTTPRouteController(gatewayInformerFactory, kubeInformerFactory, store) + require.NoError(t, err) stop := make(chan struct{}) defer close(stop) gatewayInformerFactory.Start(stop) @@ -461,7 +462,8 @@ func TestHTTPRouteController_SyncHandler_WaitsForGatewayCreatedLater(t *testing. _, err := gatewayClient.GatewayV1().HTTPRoutes(ns).Create(ctx, httpRoute, metav1.CreateOptions{}) assert.NoError(t, err) - ctrl := NewHTTPRouteController(gatewayInformerFactory, kubeInformerFactory, store) + ctrl, err := NewHTTPRouteController(gatewayInformerFactory, kubeInformerFactory, store) + require.NoError(t, err) stop := make(chan struct{}) defer close(stop) gatewayInformerFactory.Start(stop)