Skip to content

Commit

Permalink
Include required codegen files in Go module (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
seaneganx authored Sep 29, 2021
1 parent c8b9dcc commit b558b78
Show file tree
Hide file tree
Showing 33 changed files with 13,602 additions and 208 deletions.
25 changes: 9 additions & 16 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,36 +44,29 @@ jobs:
# Map tcp service container port 5432 to the host.
- 5432:5432
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: 1.15.*

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

- name: Get protoc
run: |
sudo ./tools/FETCH-PROTOC.sh
sudo chown -R $USER /usr/local
- name: Build
run: make all

- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.36
args: --timeout 5m0s

- name: Test
run: |
export APG_REGISTRY_ADDRESS=localhost:8080
export APG_REGISTRY_AUDIENCES=http://localhost:8080
export APG_REGISTRY_INSECURE=1
registry-server &
make test
- name: Install
run: go install ./...

- name: Test everything with SQLite
run: registry-server & make test
env:
APG_REGISTRY_ADDRESS: localhost:8080
APG_REGISTRY_AUDIENCES: http://localhost:8080
APG_REGISTRY_INSECURE: 1

- name: Configure PostgreSQL
env:
Expand Down
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Generated files
cmd/apg/*.go
gapic/*.go
rpc/*.go
*.pb.go
*.bleve
deployments/envoy/proto.pb
docs/

# VSCode
.vscode/
Expand Down
22 changes: 14 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
lite:
go install ./...

all: protos
all:
./tools/GENERATE-RPC.sh
./tools/GENERATE-GRPC.sh
./tools/GENERATE-GAPIC.sh
./tools/GENERATE-APG.sh
./tools/GENERATE-ENVOY-DESCRIPTORS.sh
go install ./...

apg:
./tools/GENERATE-APG.sh
go install ./cmd/apg

protos:
cd third_party; sh ./SETUP.sh
./tools/COMPILE-PROTOS.sh
./tools/GENERATE-RPC.sh
./tools/GENERATE-GRPC.sh
./tools/GENERATE-GAPIC.sh

test:
go clean -testcache
go test ./...

clean:
rm -rf \
cmd/apg/*.go gapic/*.go rpc/*.go \
third_party/api-common-protos third_party/gnostic \
envoy/proto.pb \
${HOME}/.config/registry
rm -rf cmd/apg/*.go envoy/proto.pb docs/ third_party/api-common-protos

build:
ifndef REGISTRY_PROJECT_IDENTIFIER
Expand Down
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,6 @@ builds can be made with `go install ./...` or `make lite`. The Makefile also
includes targets that build and deploy the API on
[Google Cloud Run](https://cloud.google.com/run) (see below).

## Generated Components

Several directories of generated code are produced by the build process (see
the [COMPILE-PROTOS.sh](tools/COMPILE-PROTOS.sh) script for details). These
include:

- [rpc](rpc), containing generated Go Protocol Buffer support code.
- [gapic](gapic), containing the Go GAPIC (generated API client) library.
- [cmd/apg](cmd/apg), containing a generated command-line interface.

## Quickstart

The easiest way to try the Registry API is to run `registry-server` locally.
Expand Down
153 changes: 153 additions & 0 deletions gapic/doc.go

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

Loading

0 comments on commit b558b78

Please sign in to comment.