Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 8 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,26 +193,17 @@ jobs:
go-version: '1.22.x'
cache-dependency-path: src/github.com/containerd/cgroups

- name: Set env
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH

- name: Install protoc
run: |
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v21.5/protoc-21.5-linux-x86_64.zip
# /usr/local is not writable from GitHub Actions' user
sudo unzip protoc-21.5-linux-x86_64.zip -d /usr/local
- name: Install buf
uses: bufbuild/buf-action@v1
with:
# We use the action to install buf.
setup_only: true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The action no longer posts PR comments because of setup_only:true.


- name: Install proto-related tools for Go
run: |
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
go install github.com/containerd/protobuild@v0.3.0
go install github.com/containerd/protobuild/cmd/go-fix-acronym@v0.3.0
- name: Install go-fix-acronym
run: go install github.com/containerd/protobuild/cmd/go-fix-acronym@v0.3.0

- name: Compare auto-generated Go files
run: |
make proto
make maintainer-clean proto
git diff --exit-code
working-directory: src/github.com/containerd/cgroups
15 changes: 12 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,16 @@ all: cgutil
cgutil:
cd cmd/cgctl && $(GO) build $(GO_BUILD_FLAGS) -v $(GO_TAGS)

# Follow GNU's standards
# https://www.gnu.org/prep/standards/html_node/Standard-Targets.html
maintainer-clean:
find cgroup1 cgroup2 \( -name '*.pb.go' -o -name '*.pb.txt' \) -delete

proto:
protobuild --quiet ${PACKAGES}
# Keep them Go-idiomatic and backward-compatible with the gogo/protobuf era.
go-fix-acronym -w -a '(Cpu|Tcp|Rss|Psi)' $(shell find cgroup1/stats/ cgroup2/stats/ -name '*.pb.go')
buf generate
@# Keep them Go-idiomatic and backward-compatible with the gogo/protobuf era.
go-fix-acronym -w -a '(Cpu|Tcp|Rss|Psi)' cgroup1/stats/metrics.pb.go cgroup2/stats/metrics.pb.go
buf build --exclude-source-info --path cgroup1/stats/metrics.proto -o cgroup1/stats/metrics.pb.txt#format=txtpb
buf build --exclude-source-info --path cgroup2/stats/metrics.proto -o cgroup2/stats/metrics.pb.txt#format=txtpb

.PHONY: all cgutil maintainer-clean proto
31 changes: 0 additions & 31 deletions Protobuild.toml

This file was deleted.

6 changes: 6 additions & 0 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: v2
plugins:
- remote: buf.build/protocolbuffers/go:v1.28.1
out: .
opt:
- paths=source_relative
4 changes: 4 additions & 0 deletions buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# For details on buf.yaml configuration, visit https://buf.build/docs/configuration/v2/buf-yaml
version: v2
modules:
- path: .
Loading
Loading