Skip to content

Commit

Permalink
Migrate to buf build and get rid of manual downloaded proto files (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
majst01 authored Mar 7, 2023
1 parent b5e5395 commit eb0e30a
Show file tree
Hide file tree
Showing 39 changed files with 14,763 additions and 11,093 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.16
uses: actions/setup-go@v2
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.16
go-version: "1.20"
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v3
with:
args: -p bugs -p unused

Expand Down
17 changes: 4 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,10 @@ fmt:
vet:
go vet ./...

.PHONY: third-party
third-party:
rm -rf api/google/api api/protoc-gen-swagger/options
mkdir -p api/google/api api/protoc-gen-swagger/options
wget https://raw.githubusercontent.com/grpc-ecosystem/grpc-gateway/v1/protoc-gen-swagger/options/annotations.proto -O api/protoc-gen-swagger/options/annotations.proto
wget https://raw.githubusercontent.com/grpc-ecosystem/grpc-gateway/v1/protoc-gen-swagger/options/openapiv2.proto -O api/protoc-gen-swagger/options/openapiv2.proto
wget https://raw.githubusercontent.com/googleapis/api-common-protos/master/google/api/annotations.proto -O api/google/api/annotations.proto
wget https://raw.githubusercontent.com/googleapis/api-common-protos/master/google/api/http.proto -O api/google/api/http.proto
wget https://raw.githubusercontent.com/googleapis/api-common-protos/master/google/api/httpbody.proto -O api/google/api/httpbody.proto

.PHONY: protoc
protoc: third-party
docker run --rm --user $$(id -u):$$(id -g) -v ${PWD}:/work metalstack/builder protoc -I api --go_out=plugins=grpc:api api/lightbits/api/duros/v2/*.proto
protoc:
rm -rf api/*
make -C proto protoc

.PHONY: protoc-ci
protoc-ci: third-party
Expand All @@ -44,4 +35,4 @@ protoc-ci: third-party
.PHONY: mocks
mocks:
rm -rf api/duros/v2/mocks/*
docker run --user $$(id -u):$$(id -g) --rm -w /work -v ${PWD}:/work vektra/mockery:v2.14.0 -r --all --keeptree --dir api/duros/v2 --output api/duros/v2/mocks
docker run --user $$(id -u):$$(id -g) --rm -w /work -v ${PWD}:/work vektra/mockery:v2.21.1 -r --all --keeptree --dir api/duros/v2 --output api/duros/v2/mocks
9,371 changes: 3,455 additions & 5,916 deletions api/duros/v2/durosapiv2.pb.go

Large diffs are not rendered by default.

2,541 changes: 2,541 additions & 0 deletions api/duros/v2/durosapiv2_grpc.pb.go

Large diffs are not rendered by default.

Loading

0 comments on commit eb0e30a

Please sign in to comment.