Skip to content

chore: add golang workflow#4630

Closed
JoeWang1127 wants to merge 11 commits intomainfrom
chore/go-workflow
Closed

chore: add golang workflow#4630
JoeWang1127 wants to merge 11 commits intomainfrom
chore/go-workflow

Conversation

@JoeWang1127
Copy link
Contributor

Add golang workflow, install Go dependencies to run all unit tests in golang package.

Fixes #4628

@gemini-code-assist
Copy link
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@codecov
Copy link

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.75%. Comparing base (d5d1315) to head (9bb6f03).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4630      +/-   ##
==========================================
+ Coverage   79.27%   79.75%   +0.47%     
==========================================
  Files         110      110              
  Lines        9275     9275              
==========================================
+ Hits         7353     7397      +44     
+ Misses       1410     1346      -64     
- Partials      512      532      +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JoeWang1127 JoeWang1127 marked this pull request as ready for review March 17, 2026 17:26
@JoeWang1127 JoeWang1127 requested a review from a team as a code owner March 17, 2026 17:26
go install google.golang.org/protobuf/cmd/protoc-gen-go@v${GO_PROTOC_PLUGIN_VERSION}
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v${GO_PROTOC_GRPC_PLUGIN_VERSION}
go install github.com/googleapis/gapic-generator-go/cmd/protoc-gen-go_gapic@v${GO_GAPIC_VERSION}
go install golang.org/x/tools/cmd/goimports@latest
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to install dependencies using go mod tidy since these dependencies are listed in go.mod but it didn't work.

Copy link
Member

Choose a reason for hiding this comment

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

Use go tool install https://tip.golang.org/doc/go1.24#tools

Also I'm not sure I understand why you need this. The tests run in .github/workflows/librarian.yaml

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also I'm not sure I understand why you need this. The tests run in .github/workflows/librarian.yaml

I tested that not all unit tests are run in that workflow because some unit tests require toolings installed, e.g., gapic-generator-go.

The golang tests in this workflow runs for 12s while in librarian.yaml it only needs 2s.

uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
create-issue-on-failure:
Copy link
Member

Choose a reason for hiding this comment

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

It might make sense to create a .github/workflows/postsubmit.yaml file, so that we can share the same template across languages

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Filed #4631 as a follow up.

@julieqiu
Copy link
Member

@JoeWang1127 - I'm not sure we need this PR if we are going to do #4631

@JoeWang1127
Copy link
Contributor Author

@JoeWang1127 - I'm not sure we need this PR if we are going to do #4631

I think we still need this change because not all golang unit tests are running in CI.

@JoeWang1127 JoeWang1127 deleted the chore/go-workflow branch March 19, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

golang: create a dedicated workflow to test golang package

2 participants