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.

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 22, 2022
1 parent 12b02a1 commit c59138c
Show file tree
Hide file tree
Showing 11 changed files with 3,728 additions and 3,728 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,50 @@ env:
GOPROXY: off

jobs:
proto:
runs-on: 'windows-2019'
steps:
- uses: actions/checkout@v2
with:
path: src/github.com/Microsoft/hcsshim
- uses: actions/setup-go@v2
with:
go-version: '^1.15.0'

- name: Install protoc-gen-gogoctrd
shell: bash
run: |
git clone --depth 1 https://github.com/containerd/containerd.git -b v1.6.0
cd containerd/cmd/protoc-gen-gogoctrd
go build
mkdir $GOPATH/bin
mv protoc-gen-gogoctrd.exe $GOPATH/bin
env:
GOPATH: ${{ github.workspace }}

- name: Install protoc
shell: bash
run: |
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.19.4/protoc-3.19.4-win32.zip
unzip -x protoc-3.19.4-win32.zip
mv include src/github.com/Microsoft/hcsshim/protobuf
mv bin/protoc.exe $GOPATH/bin
env:
GOPATH: ${{ github.workspace }}

- name: Run Protobuild
shell: bash
run: |
go install github.com/containerd/protobuild@7e5ee24bc1f70e9e289fef15e2631eb3491320bf
cd src/github.com/Microsoft/hcsshim
PATH=$GOPATH/bin:$PATH protobuild $(go list ./... | grep -v /vendor/)
git diff --exit-code
env:
GOPATH: ${{ github.workspace }}
GOFLAGS:
GOPROXY:

lint:
runs-on: 'windows-2019'
steps:
Expand Down
2 changes: 1 addition & 1 deletion 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 Down
Loading

0 comments on commit c59138c

Please sign in to comment.