Skip to content

Commit

Permalink
CI: "make generate" target; pin tool versions
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc committed Mar 6, 2024
1 parent e611d01 commit ef7a1af
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ cscli: goversion ## Build cscli
crowdsec: goversion ## Build crowdsec
@$(MAKE) -C $(CROWDSEC_FOLDER) build $(MAKE_FLAGS)

.PHONY: generate ## Generate code for the database and APIs
generate:
$(GO) generate ./pkg/database/ent
$(GO) generate ./pkg/models

.PHONY: testclean
testclean: bats-clean ## Remove test artifacts
Expand Down
2 changes: 1 addition & 1 deletion pkg/database/ent/generate.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ent

//go:generate go run -mod=mod entgo.io/ent/cmd/ent generate ./schema
//go:generate go run -mod=mod entgo.io/ent/cmd/ent@v0.12.4 generate ./schema

4 changes: 4 additions & 0 deletions pkg/models/generate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package models

//go:generate go run -mod=mod github.com/go-swagger/go-swagger/cmd/[email protected] generate model --spec ./localapi_swagger.yaml

0 comments on commit ef7a1af

Please sign in to comment.