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 22, 2022
1 parent 12b02a1 commit 593f21e
Show file tree
Hide file tree
Showing 18 changed files with 4,953 additions and 5,018 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:
# TODO: use Windows after merginig https://github.com/containerd/protobuild/pull/51.
runs-on: 'ubuntu-20.04'
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 $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-linux-x86_64.zip
unzip -x protoc-3.19.4-linux-x86_64.zip
mv include src/github.com/Microsoft/hcsshim/protobuf
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 593f21e

Please sign in to comment.