Skip to content

Merge pull request #3728 from k0sproject/backport-2847-to-release-1.25 #855

Merge pull request #3728 from k0sproject/backport-2847-to-release-1.25

Merge pull request #3728 from k0sproject/backport-2847-to-release-1.25 #855

Workflow file for this run

name: Go lint
on:
push:
branches:
- main
- release-*
paths-ignore:
- 'docs/**'
- 'examples/**'
- '**.md'
- LICENSE
- '**.svg'
- '.github/workflows/docs.yml'
- '.github/workflows/mkdocs-set-default-version.yml'
- 'mkdocs.yml'
pull_request:
branches:
- main
- release-*
paths-ignore:
- 'docs/**'
- 'examples/**'
- '**.md'
- LICENSE
- README.md
- '**.svg'
- '.github/workflows/docs.yml'
- '.github/workflows/mkdocs-set-default-version.yml'
- 'mkdocs.yml'
- '*.md'
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Prepare build environment
run: .github/workflows/prepare-build-env.sh
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Go caches
uses: actions/cache@v3
with:
key: ${{ runner.os }}-lint-go-caches-${{ hashFiles('go.sum') }}
path: |
build/cache
~/go/pkg/mod
~/.cache/go-build
~/.cache/golangci-lint
- name: Check go.mod/go.sum to be consistent
run: make --always-make go.sum && git diff --exit-code
- name: Check generated code to be consistent
run: make codegen EMBEDDED_BINS_BUILDMODE=none && git diff --exit-code
- name: Run linter
env:
EMBEDDED_BINS_BUILDMODE: none
GOLANGCI_LINT_FLAGS: --out-format=github-actions
run: |
make lint