Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic CI for Go CF Driver #71

Merged
merged 18 commits into from
Dec 18, 2024
Merged

Basic CI for Go CF Driver #71

merged 18 commits into from
Dec 18, 2024

Conversation

zjrgov
Copy link
Contributor

@zjrgov zjrgov commented Dec 18, 2024

🎫 Addresses issue: https://github.com/GSA-TTS/devtools-program/issues/171

Go Runner CI testing, linting, etc.

🛠 Summary of changes

Adds a very basic workflow to run fmt, vet, build & test on the Go cf-driver.

@zjrgov zjrgov marked this pull request as ready for review December 18, 2024 15:42
@zjrgov zjrgov requested a review from a team December 18, 2024 15:42
@zjrgov zjrgov self-assigned this Dec 18, 2024
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
Copy link
Contributor

Choose a reason for hiding this comment

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

[question] can we start out with v5 of the action?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably? I didn't realized I'd picked an old one, can you tell me how this came up for you?

Copy link
Contributor

Choose a reason for hiding this comment

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

I checked the action readme to see if we could avoid passing go-version (seems like no? but if we can just have it inherit from go.mod that'd be ideal) and saw that v5 was out

Copy link
Contributor Author

@zjrgov zjrgov Dec 18, 2024

Choose a reason for hiding this comment

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

Ah, I was hoping some automated thing had surfaced it :-/

But yeah, that's what I had initially planned to do, but then something I read in documentation made me think specifying a version would result in GitHub being more likely to pull a cached version of Go--and that seemed like a nice enough upside to me. I meant to verify it actually made a difference, though, and I forgot to do that.

Copy link
Contributor Author

@zjrgov zjrgov Dec 18, 2024

Choose a reason for hiding this comment

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

So, it does make a difference, but not a particularly large difference. Specifying a 1.23.x version for the action takes < 1s, using the go.mod takes ~8s—after the initial run which was an extra ~22s, but I'm thinking this probably wouldn't happen often.

I think for 8s it probably isn't worth it, and it might be faster if I don't specify a patch version in go.mod, which we have no reason to do.

Edit: indeed dropping the patch version takes it back to pulling whatever GitHub already had on hand and was a nice ~2s.

@@ -18,7 +18,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23.x"
go-version-file: runner/cf-driver-go/go.mod
Copy link
Contributor

Choose a reason for hiding this comment

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

[praise] nice!

@zjrgov zjrgov merged commit bd2d61c into go/main Dec 18, 2024
1 check passed
@zjrgov zjrgov deleted the go/basic-ci branch December 18, 2024 16:16
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.

2 participants