Skip to content

Commit

Permalink
Run Protobuild on GitHub Actions
Browse files Browse the repository at this point in the history
containerd is planning to migrate off from github.com/gogo/protobuf
which will affect hcsshim.
See containerd/containerd#6564 for
the overall progress.

Before that, this commit runs Protobuild in GitHub Actions to
make sure all generated files are reproducible from .proto files.

Signed-off-by: Kazuyoshi Kato <[email protected]>
  • Loading branch information
kzys committed Feb 28, 2022
1 parent 12b02a1 commit 430008a
Show file tree
Hide file tree
Showing 18 changed files with 4,954 additions and 5,023 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,51 @@ env:
GOPROXY: off

jobs:
protos:
runs-on: 'windows-2019'
steps:
- uses: actions/setup-go@v2
with:
go-version: '^1.15.0'
# Install protoc-gen-gogoctrd in D:\bin
- uses: actions/checkout@v2
with:
repository: containerd/containerd
ref: v1.6.0
path: 'containerd'
- name: Install protoc-gen-gogoctrd
shell: powershell
run: |
cd containerd\cmd\protoc-gen-gogoctrd
go build
mkdir D:\bin
mv protoc-gen-gogoctrd.exe D:\bin
- uses: actions/checkout@v2
with:
path: 'go/src/github.com/Microsoft/hcsshim'
# Install protoc in D:\bin
- name: Install protoc
shell: powershell
run: |
Invoke-WebRequest -OutFile protoc.zip -Uri https://github.com/protocolbuffers/protobuf/releases/download/v3.19.4/protoc-3.19.4-win32.zip
Expand-Archive -Path protoc.zip -DestinationPath .
mv include go/src/github.com/Microsoft/hcsshim/protobuf
mv bin\protoc.exe D:\bin
- name: Run Protobuild
shell: powershell
run: |
go install github.com/containerd/protobuild@f9731edc8a06ed5d5f7dc7c6c0304cd34af13f21
cd go\src\github.com\Microsoft\hcsshim
$Env:Path += ";D:\bin;" + $Env:GOPATH + "\bin"
protobuild $(go list ./... | grep -v /vendor/)
git diff --exit-code
env:
GOPATH: '${{ github.workspace }}\go'
GOFLAGS:
GOPROXY:

lint:
runs-on: 'windows-2019'
steps:
Expand Down
7 changes: 1 addition & 6 deletions Protobuild.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "unstable"
version = "1"
generator = "gogoctrd"
plugins = ["grpc", "fieldpath"]

Expand All @@ -14,11 +14,6 @@ plugins = ["grpc", "fieldpath"]
# target package.
packages = ["github.com/gogo/protobuf"]

# Paths that will be added untouched to the end of the includes. We use
# `/usr/local/include` to pickup the common install location of protobuf.
# This is the default.
after = ["/usr/local/include"]

# This section maps protobuf imports to Go packages. These will become
# `-M` directives in the call to the go protobuf generator.
[packages]
Expand Down
Loading

0 comments on commit 430008a

Please sign in to comment.