Skip to content

Merge pull request #5684 from k0sproject/dependabot/github_actions/sh… #9489

Merge pull request #5684 from k0sproject/dependabot/github_actions/sh…

Merge pull request #5684 from k0sproject/dependabot/github_actions/sh… #9489

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'
env:
MAKEFLAGS: -j
jobs:
lint:
name: Lint
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Go caches
uses: actions/cache@v4
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
run: |
make lint
validate-os-tests:
name: Validate OS tests
runs-on: ubuntu-24.04
env:
TOFU_VERSION: 1.9.0
defaults:
run:
working-directory: hack/ostests
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: hack/ostests
persist-credentials: false
- uses: opentofu/setup-opentofu@v1
with:
tofu_version: ${{ env.TOFU_VERSION }}
tofu_wrapper: false
- run: tofu fmt -check
- run: tofu init
- run: tofu validate -no-color