Remove runtime go image and replace it with default debian image #808
Workflow file for this run
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
name: Go | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v5.0.1 | |
with: | |
go-version: 1.21.x | |
id: go | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4.1.7 | |
- name: Install kubebuilder | |
# see kubebuilder book: https://book.kubebuilder.io/quick-start.html | |
run: | | |
version="3.1.0" | |
os=$(go env GOOS) | |
arch=$(go env GOARCH) | |
curl -L -o kubebuilder https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${version}/kubebuilder_${os}_${arch} | |
sudo chmod +x kubebuilder | |
sudo mv kubebuilder /usr/local/ | |
- name: Get go dependencies | |
run: | | |
go install -v ./... | |
go install -v golang.org/x/lint/golint | |
go install -v golang.org/x/tools/cmd/goimports | |
- name: Check for format and lint issues | |
run: | | |
# see https://github.com/golang/go/issues/24230 | |
fmtcode="$(gofmt -s -d -l .)" | |
echo $fmtcode && test -z "$fmtcode" | |
lintcode="$(golint ./...)" | |
echo $lintcode && test -z "$lintcode" | |
- name: Check imports | |
run: goimports -l . | |
- name: Build | |
run: go build ./... | |
- name: Vet | |
run: make vet | |
- name: Test | |
run: make test |