Skip to content

Commit

Permalink
test: enable k8s matrix (#304)
Browse files Browse the repository at this point in the history
* test: enable k8s matrix

* test: k8s version not effect from ci
  • Loading branch information
whg517 authored Jan 20, 2025
1 parent cdfa0de commit 19fced1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ jobs:
go-test:
name: Go Test
runs-on: ubuntu-latest
strategy:
matrix:
# https://github.com/kubernetes-sigs/controller-tools/releases
k8s-version: [
'1.26.1',
'1.27.1',
'1.28.3',
'1.29.1',
'1.30.3',
'1.31.0',
'1.32.0',
]
steps:
- name: Clone the code
uses: actions/checkout@v4
Expand All @@ -18,6 +30,8 @@ jobs:
go-version: '~1.23'

- name: Running Tests
env:
ENVTEST_K8S_VERSION: ${{ matrix.k8s-version }}
run: |
go mod tidy
make test
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.26.1
# You can find the list of released envtest-k8s versions with `Release envtest` from https://github.com/kubernetes-sigs/controller-tools/releases
ENVTEST_K8S_VERSION ?= 1.26.1

##@ Development

Expand Down

0 comments on commit 19fced1

Please sign in to comment.