hashicorp / terraform-plugin-go

A low-level Go binding for the Terraform protocol for integrations to be built on top of.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add CI Workflow for Protobuf Compilation

bflad opened this issue · comments

terraform-plugin-go version

v0.8.0

Use cases

The Protocol Buffers compilation via the protoc tool is currently handled outside go generate so all dependencies of that execution can be handled via Go modules and go get. There can be changes to this ecosystem we would like to follow along for updates, so we should raise our confidence in these changes by introducing additional CI processes for this area.

Attempted solutions

Locally, switch to dependency upgrade branch, install protoc (if not done so already), run protoc, and check Git for differences.

Proposal

Introduce a new GitHub Actions based workflow specifically for protobuf changes, e.g. .github/workflows/ci-protobuf.yml. That:

  • Only has read-only permissions to the repository contents
  • Only runs on the pull_request event of certain paths such as:
    • .github/workflows/ci-protobuf.yml
    • go.mod
    • go.sum
    • tfprotov5/internal/tfplugin5/*
    • tfprotov6/internal/tfplugin6/*
  • Checks out code
  • Installs Go (e.g. actions/setup-go)
  • Installs protoc (e.g. arduino/setup-protoc)
  • Runs protoc (refer also to generate.sh)
  • Checks Git for differences and fails if any are detected

References

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.