Files
helm-dashboard/.github/workflows/build.yml
T
Andrey Pokhilko d8411ae0dc chore: upgrade Go toolchain to 1.25 and bump helm to v3.20.2 (#679)
* chore: upgrade Go toolchain to 1.25 and bump helm to v3.20.2

Upgrades Go from 1.24 to 1.25 in go.mod and CI workflow to fix
golangci-lint compatibility. Includes helm.sh/helm/v3 bump to v3.20.2.

Supersedes #678.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(ci): upgrade golangci-lint-action to v7 for Go 1.25 support

Action v4 installs golangci-lint v1.x which was built with Go 1.24
and refuses to lint Go 1.25 code. Action v7 uses golangci-lint v2.x
built with Go 1.25+.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: resolve golangci-lint v2 warnings

Handle Body.Close error returns and remove redundant embedded field
selector to satisfy stricter golangci-lint v2 defaults.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 09:27:15 +01:00

139 lines
4.0 KiB
YAML

name: Build
on:
push:
branches:
- main
pull_request:
branches:
- "*"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# Node part
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: NPM install
run: npm i
working-directory: ./frontend
- name: NPM build
run: npm run build
working-directory: ./frontend
# Golang part
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25"
- name: Unit tests
run: |
go test -v -race ./... -covermode=atomic -coverprofile=coverage.out # Run all the tests with the race detector enabled
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
- name: Static analysis
run: |
go vet ./... # go vet is the official Go static analyzer
- name: Cyclomatic complexity
run: |
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
/home/runner/go/bin/gocyclo -over 19 main.go pkg # forbid code with huge/complex functions
- name: Dry Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: "1.18.2"
args: release --snapshot --clean
- name: Test if the Binary is Runnable
run: "dist/helm-dashboard_linux_amd64_v1/helm-dashboard --help"
- uses: actions/upload-artifact@v4
with:
name: binaries
path: dist/
retention-days: 1
image:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Docker meta
uses: docker/metadata-action@v3
id: meta
with:
images: komodorio/helm-dashboard
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
if: github.event_name != 'pull_request'
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: komodorio/helm-dashboard:unstable
labels: ${{ steps.meta.outputs.labels }}
build-args: VER=0.0.0-dev
platforms: linux/amd64,linux/arm64
static_and_lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: make dir for frontend results # don't delete this step, it will break goreleaser
run: mkdir pkg/frontend/dist && touch pkg/frontend/dist/.gitkeep
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25"
- name: golangci-lint
uses: golangci/golangci-lint-action@v7
with:
args: --timeout=5m
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
cache: 'npm'
cache-dependency-path: ./frontend/package-lock.json
- name: NPM install
run: npm i
working-directory: ./frontend
- name: NPM lint
run: npm run lint
working-directory: ./frontend
- name: Helm Template Check For Sanity
uses: igabaydulin/helm-check-action@0.2.1
env:
CHART_LOCATION: ./charts/helm-dashboard
CHART_VALUES: ./charts/helm-dashboard/values.yaml
- name: Test if the Helm plugin install script is runnable
run: |
scripts/install_plugin.sh