File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -193,26 +193,19 @@ jobs:
193193 go-version : ' 1.22.x'
194194 cache-dependency-path : src/github.com/containerd/cgroups
195195
196- - name : Set env
197- shell : bash
198- run : |
199- echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
200- echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
201-
202- - name : Install protoc
203- run : |
204- curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v21.5/protoc-21.5-linux-x86_64.zip
205- # /usr/local is not writable from GitHub Actions' user
206- sudo unzip protoc-21.5-linux-x86_64.zip -d /usr/local
196+ - name : Install buf
197+ uses : bufbuild/buf-action@v1
198+ with :
199+ # We don't use Buf Schema Registry.
200+ push : false
201+ format : false
202+ lint : false
207203
208- - name : Install proto-related tools for Go
209- run : |
210- go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
211- go install github.com/containerd/protobuild@v0.3.0
212- go install github.com/containerd/protobuild/cmd/go-fix-acronym@v0.3.0
204+ - name : Install go-fix-acronym
205+ run : go install github.com/containerd/protobuild/cmd/go-fix-acronym@v0.3.0
213206
214207 - name : Compare auto-generated Go files
215208 run : |
216- make proto
209+ make maintainer-clean proto
217210 git diff --exit-code
218211 working-directory : src/github.com/containerd/cgroups
Original file line number Diff line number Diff line change @@ -23,7 +23,16 @@ all: cgutil
2323cgutil :
2424 cd cmd/cgctl && $(GO ) build $(GO_BUILD_FLAGS ) -v $(GO_TAGS )
2525
26+ # Follow GNU's standards
27+ # https://www.gnu.org/prep/standards/html_node/Standard-Targets.html
28+ maintainer-clean :
29+ find cgroup1 cgroup2 \( -name ' *.pb.go' -o -name ' *.pb.txt' \) -delete
30+
2631proto :
27- protobuild --quiet ${PACKAGES}
28- # Keep them Go-idiomatic and backward-compatible with the gogo/protobuf era.
29- go-fix-acronym -w -a ' (Cpu|Tcp|Rss|Psi)' $(shell find cgroup1/stats/ cgroup2/stats/ -name '* .pb.go')
32+ buf generate
33+ @# Keep them Go-idiomatic and backward-compatible with the gogo/protobuf era.
34+ go-fix-acronym -w -a ' (Cpu|Tcp|Rss|Psi)' cgroup1/stats/metrics.pb.go cgroup2/stats/metrics.pb.go
35+ buf build --exclude-source-info --path cgroup1/stats/metrics.proto -o cgroup1/stats/metrics.pb.txt#format=txtpb
36+ buf build --exclude-source-info --path cgroup2/stats/metrics.proto -o cgroup2/stats/metrics.pb.txt#format=txtpb
37+
38+ .PHONY : all cgutil maintainer-clean proto
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ version : v2
2+ plugins :
3+ - remote : buf.build/protocolbuffers/go:v1.28.1
4+ out : .
5+ opt :
6+ - paths=source_relative
Original file line number Diff line number Diff line change 1+ # For details on buf.yaml configuration, visit https://buf.build/docs/configuration/v2/buf-yaml
2+ version : v2
3+ modules :
4+ - path : .
You can’t perform that action at this time.
0 commit comments