-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from kzys/upgrade-proto
- Loading branch information
Showing
13 changed files
with
578 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,40 @@ on: | |
branches: [ main ] | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-20.04 | ||
timeout-minutes: 5 | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
with: | ||
path: src/github.com/containerd/protobuild | ||
fetch-depth: 25 | ||
|
||
- name: Project checks | ||
uses: containerd/project-checks@v1 | ||
with: | ||
working-directory: src/github.com/containerd/protobuild | ||
|
||
- name: Setup environment | ||
shell: bash | ||
run: | | ||
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV | ||
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
with: | ||
path: src/github.com/containerd/protobuild | ||
|
||
- name: Test | ||
working-directory: src/github.com/containerd/protobuild | ||
run: | | ||
go test | ||
build: | ||
name: Protobuild CI | ||
v1: | ||
name: Run with protoc-gen-go v1.3.5 | ||
runs-on: ubuntu-20.04 | ||
timeout-minutes: 5 | ||
steps: | ||
|
@@ -30,12 +61,6 @@ jobs: | |
uses: actions/checkout@v2 | ||
with: | ||
path: src/github.com/containerd/protobuild | ||
fetch-depth: 25 | ||
|
||
- name: Project checks | ||
uses: containerd/project-checks@v1 | ||
with: | ||
working-directory: src/github.com/containerd/protobuild | ||
|
||
- name: Build | ||
working-directory: src/github.com/containerd/protobuild | ||
|
@@ -58,7 +83,55 @@ jobs: | |
- name: Run protobuild to see all committed auto-generated files can be generated as is | ||
working-directory: src/github.com/containerd/protobuild | ||
run: | | ||
find examples/ -name '*.pb.*' | xargs rm | ||
rm examples/foo/*.pb.* examples/bar/*.pb.* examples/nogrpc/*.pb.* | ||
export PATH=$(go env GOBIN):$PATH | ||
./protobuild github.com/containerd/protobuild/examples/bar github.com/containerd/protobuild/examples/foo github.com/containerd/protobuild/examples/nogrpc | ||
git diff --exit-code | ||
v2: | ||
name: Run with protoc-gen-go v1.26 | ||
runs-on: ubuntu-20.04 | ||
timeout-minutes: 5 | ||
steps: | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.16.x | ||
id: go | ||
|
||
- name: Setup environment | ||
shell: bash | ||
run: | | ||
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV | ||
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
with: | ||
path: src/github.com/containerd/protobuild | ||
|
||
- name: Build | ||
working-directory: src/github.com/containerd/protobuild | ||
run: | | ||
go build . | ||
- name: Install protoc | ||
run: | | ||
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.18.1/protoc-3.18.1-linux-x86_64.zip | ||
sudo unzip -x protoc-3.18.1-linux-x86_64.zip -d /usr/local | ||
sudo chmod -R go+rX /usr/local/include | ||
sudo chmod go+x /usr/local/bin/protoc | ||
- name: Install protoc-gen-go and protoc-gen-go-grpc | ||
run: | | ||
go install google.golang.org/protobuf/cmd/[email protected] | ||
go install google.golang.org/grpc/cmd/[email protected] | ||
- name: Run protobuild to see all committed auto-generated files can be generated as is | ||
working-directory: src/github.com/containerd/protobuild | ||
run: | | ||
rm examples/v2/*.pb.* | ||
export PATH=$(go env GOBIN):$PATH | ||
go list ./... | grep -v vendor | xargs ./protobuild | ||
./protobuild -f v2.toml github.com/containerd/protobuild/examples/v2 | ||
git diff --exit-code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
Copyright The containerd Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
// Package foo demonstrates a protobuf package. | ||
// | ||
// We include a doc.go file in here to let protobuild know to place a | ||
// Go/Protobuf package. | ||
package v2 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
syntax = "proto3"; | ||
|
||
package protobuild.example.v2; | ||
|
||
import "google/protobuf/empty.proto"; | ||
import "google/protobuf/timestamp.proto"; | ||
|
||
option go_package = "github.com/containerd/protobuild/examples/v2/;v2"; | ||
|
||
service Foo { | ||
rpc Do(DoRequest) returns (google.protobuf.Empty); | ||
} | ||
|
||
message DoRequest { | ||
google.protobuf.Timestamp timestamp = 3; | ||
} |
Oops, something went wrong.