From e38021361844fc4595397a8b78eae40c57291f76 Mon Sep 17 00:00:00 2001 From: CYJiang <86391540+googs1025@users.noreply.github.com> Date: Thu, 18 Jun 2026 18:07:06 +0800 Subject: [PATCH 1/2] ci: add formatting and helm lint checks Signed-off-by: CYJiang <86391540+googs1025@users.noreply.github.com> --- .github/workflows/lint.yml | 56 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6e1e643b3..07a284e11 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -40,3 +40,59 @@ jobs: - name: Run golangci-lint if: steps.changes.outputs.lint == 'true' run: make lint + + gofmt: + name: gofmt + runs-on: ubuntu-24.04 + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Filter paths + id: changes + uses: dorny/paths-filter@v3 + with: + filters: | + gofmt: + - '**/*.go' + - 'Makefile' + - '.github/workflows/lint.yml' + + - name: Set up Go + if: steps.changes.outputs.gofmt == 'true' + uses: actions/setup-go@v5 + with: + go-version: "1.24" + + - name: Check Go formatting + if: steps.changes.outputs.gofmt == 'true' + run: make fmt-check + + helm: + name: helm-lint + runs-on: ubuntu-24.04 + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Filter paths + id: changes + uses: dorny/paths-filter@v3 + with: + filters: | + helm: + - 'manifests/charts/base/**' + - 'Makefile' + - '.github/workflows/lint.yml' + + - name: Set up Helm + if: steps.changes.outputs.helm == 'true' + uses: azure/setup-helm@v4 + + - name: Lint Helm chart + if: steps.changes.outputs.helm == 'true' + run: make helm-lint + + - name: Render Helm chart + if: steps.changes.outputs.helm == 'true' + run: make helm-template > /tmp/agentcube-rendered.yaml From 61a35f2a346d4999fb1756777690595908c9a25c Mon Sep 17 00:00:00 2001 From: CYJiang <86391540+googs1025@users.noreply.github.com> Date: Thu, 18 Jun 2026 18:07:08 +0800 Subject: [PATCH 2/2] ci: address lint workflow review Signed-off-by: CYJiang <86391540+googs1025@users.noreply.github.com> --- .github/workflows/lint.yml | 76 ++++++++++++++++++-------------------- Makefile | 5 +++ 2 files changed, 40 insertions(+), 41 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 07a284e11..0ea4b4969 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,15 +12,16 @@ permissions: pull-requests: read jobs: - golangci: - name: golangci-lint - runs-on: ubuntu-24.04 + changes: + name: detect changes + runs-on: ubuntu-latest + outputs: + lint: ${{ steps.filter.outputs.lint }} + gofmt: ${{ steps.filter.outputs.gofmt }} + helm: ${{ steps.filter.outputs.helm }} steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Filter paths - id: changes + id: filter uses: dorny/paths-filter@v3 with: filters: | @@ -30,69 +31,62 @@ jobs: - 'go.sum' - '.golangci.yml' - '.github/workflows/lint.yml' + gofmt: + - '**/*.go' + - 'Makefile' + - '.github/workflows/lint.yml' + helm: + - 'manifests/charts/base/**' + - 'Makefile' + - '.github/workflows/lint.yml' + + golangci: + name: golangci-lint + needs: changes + if: needs.changes.outputs.lint == 'true' + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 - name: Set up Go - if: steps.changes.outputs.lint == 'true' uses: actions/setup-go@v5 with: go-version: "1.24" - name: Run golangci-lint - if: steps.changes.outputs.lint == 'true' run: make lint gofmt: name: gofmt - runs-on: ubuntu-24.04 + needs: changes + if: needs.changes.outputs.gofmt == 'true' + runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - - name: Filter paths - id: changes - uses: dorny/paths-filter@v3 - with: - filters: | - gofmt: - - '**/*.go' - - 'Makefile' - - '.github/workflows/lint.yml' - - name: Set up Go - if: steps.changes.outputs.gofmt == 'true' uses: actions/setup-go@v5 with: go-version: "1.24" - name: Check Go formatting - if: steps.changes.outputs.gofmt == 'true' run: make fmt-check helm: name: helm-lint - runs-on: ubuntu-24.04 + needs: changes + if: needs.changes.outputs.helm == 'true' + runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - - name: Filter paths - id: changes - uses: dorny/paths-filter@v3 - with: - filters: | - helm: - - 'manifests/charts/base/**' - - 'Makefile' - - '.github/workflows/lint.yml' - - name: Set up Helm - if: steps.changes.outputs.helm == 'true' uses: azure/setup-helm@v4 + with: + version: v3.17.3 - - name: Lint Helm chart - if: steps.changes.outputs.helm == 'true' - run: make helm-lint - - - name: Render Helm chart - if: steps.changes.outputs.helm == 'true' - run: make helm-template > /tmp/agentcube-rendered.yaml + - name: Check Helm chart + run: make helm-check diff --git a/Makefile b/Makefile index 3cf7f8cce..706e026e7 100644 --- a/Makefile +++ b/Makefile @@ -297,6 +297,11 @@ helm-template: ## Render Helm chart locally helm-lint: ## Lint Helm chart helm lint manifests/charts/base +.PHONY: helm-check +helm-check: ## Lint Helm chart and verify templates render + $(MAKE) helm-lint + $(MAKE) helm-template >/dev/null + ##@ Dependencies