diff --git a/.github/workflows/generate-go.yml b/.github/workflows/generate-files.yml similarity index 63% rename from .github/workflows/generate-go.yml rename to .github/workflows/generate-files.yml index 936e4801f5..a76000a0de 100644 --- a/.github/workflows/generate-go.yml +++ b/.github/workflows/generate-files.yml @@ -1,4 +1,4 @@ -name: Generated Go/OpenAPI to Match Protobuf +name: Generated Files are Updated on: pull_request: branches: @@ -17,14 +17,20 @@ jobs: run: | echo "$HOME/go/bin" >> $GITHUB_PATH - - name: Generate Go and OpenAPI + - name: Generate Go code from proto files run: make proto + - name: Generate OpenAPI + run: make openapi + + - name: Generate Module Documentation + run: make specs + - name: Check for changes run: | if git diff --exit-code --ignore-space-change --ignore-all-space --ignore-cr-at-eol; then echo "Generated Go files are up-to-date." else - echo "::error::Generated Go and/or OpenAPI files are not up-to-date. Please run 'make proto' locally and commit any changes." + echo "::error::Generated files are not up-to-date. Please run 'make generate' locally and commit any changes." exit 1 fi diff --git a/Makefile b/Makefile index 38523c20cd..d3f29e7c2f 100644 --- a/Makefile +++ b/Makefile @@ -140,18 +140,21 @@ proto: @find . -name '*.pb.go' -type f -delete @echo "--> Generating new Go types from protocol buffer files" @bash ./scripts/protoc-gen-go.sh +.PHONY: proto + +openapi: @echo "--> Generating OpenAPI specs" @bash ./scripts/protoc-gen-openapi.sh - -proto-format: - @bash ./scripts/proto-format.sh - -.PHONY: proto +.PHONY: openapi specs: + @echo "--> Generating module documentation" @go run ./scripts/gen-spec.go .PHONY: specs +generate: proto openapi specs +.PHONY: generate + ############################################################################### ### Docker Images ### ###############################################################################