wip #1479
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is maintained centrally in | |
# https://github.com/giantswarm/github/blob/main/languages/go/pre_commit_go.yaml | |
name: pre-commit | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Check out code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Set up Python environment | |
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 | |
- name: Set up Go environment | |
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 | |
with: | |
go-version: "1.24" | |
- name: Install goimports | |
run: | | |
go install golang.org/x/tools/cmd/[email protected] | |
- name: Install golangci-lint | |
uses: giantswarm/install-binary-action@c37eb401e5092993fc76d545030b1d1769e61237 # v3.0.0 | |
with: | |
binary: golangci-lint | |
version: "2.1.6" | |
download_url: "https://github.com/golangci/golangci-lint/releases/download/v${version}/${binary}-${version}-linux-amd64.tar.gz" | |
- name: Execute pre-commit hooks | |
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 | |
env: | |
GOGC: "20" |