diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2c66e657f..b28274a6e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -50,11 +50,24 @@ jobs: # Check that the generated ent code is up to date # see https://entgo.io/docs/ci/ - uses: ent/contrib/ci@e38dfb6484dfbe64b8bd060fe6a219a1aa5da770 # master - name: "Check all generated code is checked in" + name: "Check all ent generated code is checked in" if: ${{ matrix.app != 'main-module' }} with: working-directory: app/${{ matrix.app }} + # Check that the generated API code is up to date + # We install the tools and run the protoc generation before checking differences + - name: "Check all API generated code is checked in" + if: ${{ matrix.app == 'main-module' }} + run: | + make init-api-tools + make api + if [ -n "$(git status --porcelain)" ]; then + echo "Error: The Git repository is dirty (has uncommitted changes). Make sure all the generated API-related files are checked in." + git status --porcelain + exit 1 + fi + - name: Test if: ${{ matrix.app != 'main-module' }} run: make -C app/${{ matrix.app }} test diff --git a/app/artifact-cas/api/cas/v1/status_http.pb.go b/app/artifact-cas/api/cas/v1/status_http.pb.go index c5262b0e5..7c3d1d38a 100644 --- a/app/artifact-cas/api/cas/v1/status_http.pb.go +++ b/app/artifact-cas/api/cas/v1/status_http.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-http. DO NOT EDIT. // versions: -// - protoc-gen-go-http v2.7.0 +// - protoc-gen-go-http v2.7.1 // - protoc (unknown) // source: cas/v1/status.proto diff --git a/app/controlplane/api/controlplane/v1/status_http.pb.go b/app/controlplane/api/controlplane/v1/status_http.pb.go index 2763fbfee..e39d0e12c 100644 --- a/app/controlplane/api/controlplane/v1/status_http.pb.go +++ b/app/controlplane/api/controlplane/v1/status_http.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-http. DO NOT EDIT. // versions: -// - protoc-gen-go-http v2.7.0 +// - protoc-gen-go-http v2.7.1 // - protoc (unknown) // source: controlplane/v1/status.proto diff --git a/common.mk b/common.mk index 86cf4955e..baa1da22c 100644 --- a/common.mk +++ b/common.mk @@ -2,16 +2,21 @@ VERSION=$(shell git describe --tags --always) .PHONY: init # init env -init: - go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.31.0 - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0 - go install github.com/envoyproxy/protoc-gen-validate@v1.0.1 - go install github.com/go-kratos/kratos/cmd/protoc-gen-go-errors/v2@latest - go install github.com/go-kratos/kratos/cmd/protoc-gen-go-http/v2@latest +init: init-api-tools go install github.com/google/wire/cmd/wire@latest go install github.com/vektra/mockery/v2@v2.20.0 go install ariga.io/atlas/cmd/atlas@v0.12.0 + +# initialize API tooling +.PHONY: init-api-tools +init-api-tools: + go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.31.0 + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0 go install github.com/bufbuild/buf/cmd/buf@v1.10.0 + go install github.com/envoyproxy/protoc-gen-validate@v1.0.1 + # Tools fixed to a specific version via its commit since they are not released standalone + go install github.com/go-kratos/kratos/cmd/protoc-gen-go-errors/v2@v2.0.0-20231102162905-3fc8fb7a0a0b + go install github.com/go-kratos/kratos/cmd/protoc-gen-go-http/v2@v2.0.0-20231102162905-3fc8fb7a0a0b # show help help: