ci: Update Go setup and linter versions in lint.yml #35
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: Tests | |
on: | |
push: | |
paths-ignore: | |
- "**.md" | |
pull_request: | |
paths-ignore: | |
- "**.md" | |
jobs: | |
test: | |
name: Unit Tests | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Clone the code | |
uses: actions/checkout@v4.2.2 | |
- name: Setup Go | |
uses: actions/setup-go@v5.4.0 | |
with: | |
go-version-file: go.mod | |
- name: Install go-task | |
run: | | |
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin | |
- name: Install controller-gen and kustomize | |
run: | | |
CONTROLLER_GEN_VERSION=v0.17.2 | |
KUSTOMIZE_VERSION=v5.6.0 | |
ENVTEST_VERSION=latest | |
# Install controller-gen globally | |
go install sigs.k8s.io/controller-tools/cmd/controller-gen@${CONTROLLER_GEN_VERSION} | |
# Install kustomize globally | |
go install sigs.k8s.io/kustomize/kustomize/v5@${KUSTOMIZE_VERSION} | |
# Install setup-envtest globally | |
go install sigs.k8s.io/controller-runtime/tools/setup-envtest@${ENVTEST_VERSION} | |
# Verify installations | |
controller-gen --version || (echo "controller-gen not installed" && exit 1) | |
kustomize version || (echo "kustomize not installed" && exit 1) | |
setup-envtest version || (echo "setup-envtest not installed" && exit 1) | |
- name: Running Tests | |
run: | | |
go mod tidy | |
task test |