Skip to content

Commit

Permalink
ci: add controller-gen step to the pipeline (#14)
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
  • Loading branch information
fcanovai authored Sep 17, 2024
1 parent 4b05040 commit 13369fe
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
version: '3'

tasks:
controller-gen:
desc: Run controller-gen
env:
# renovate: datasource=git-refs depName=controller-gen lookupName=https://github.com/cloudnative-pg/daggerverse currentValue=main
DAGGER_CONTROLLER_GEN_SHA: b618555de0679df409b6c688ab5fa30590e97148
cmds:
- >
GITHUB_REF= dagger -s call -m github.com/cloudnative-pg/daggerverse/controller-gen@${DAGGER_CONTROLLER_GEN_SHA}
controller-gen --source . --args object:headerFile=hack/boilerplate.go.txt --args paths=./pkg/api/...
file --path pkg/api/zz_generated.deepcopy.go export --path pkg/api/zz_generated.deepcopy.go
sources:
- ./pkg/api/**/*.go
generates:
- ./pkg/api/zz_generated.deepcopy.go

spellcheck:
desc: Run spellcheck
env:
Expand Down Expand Up @@ -43,11 +58,15 @@ tasks:
- >
GITHUB_REF= dagger -s call -m github.com/cloudnative-pg/daggerverse/uncommitted@${DAGGER_UNCOMMITTED_SHA}
check-uncommitted --source . stdout
deps:
- controller-gen
sources:
- ./**

go-test:
desc: Run go test
deps:
- controller-gen
env:
# renovate: datasource=docker depName=golang versioning=semver
GOLANG_IMAGE_VERSION: 1.23.1
Expand Down
15 changes: 15 additions & 0 deletions hack/boilerplate.go.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
Copyright The CloudNativePG Contributors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
4 changes: 4 additions & 0 deletions pkg/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// +genclient
// +kubebuilder:object:root=true
// +k8s:deepcopy-gen=package

package api

import corev1 "k8s.io/api/core/v1"
Expand Down
70 changes: 70 additions & 0 deletions pkg/api/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 13369fe

Please sign in to comment.