ci/cd: parallel CI jobs + security scanning (build, vet, test, tidy, lint, govulncheck, gosec, CodeQL, dependency-review)#261
Merged
Conversation
No CI existed. Adds .github/workflows/ci.yml running go build / vet / test on push to development|master and on every PR (Go 1.25, module cache). A golangci-lint v2 job runs advisory-only for now (the repo's strict config was never enforced in CI); flip continue-on-error once the tree is lint-clean.
golangci-lint-action@v6 installs golangci-lint v1, incompatible with the repo's v2 config. Install v2 via the official script instead. Still advisory (continue-on-error) until the tree is lint-clean.
Public repo, so Actions minutes are free — but keep it lean: trigger on pull_request (feature pushes covered by their PR) plus push to master; drop the separate golangci-lint download job (go vet stays); keep caching and cancel-in-progress.
CI (ci.yml): Build, Vet, Test, Tidy as blocking parallel jobs; Format and Lint advisory (pre-existing test-file gofmt + never-enforced golangci config). Security (security.yml): govulncheck, gosec, CodeQL, and Dependency Review as separate parallel jobs (advisory scanners to start), on PR / push-to-master / weekly. Every job restores the Go build+module cache to stay fast.
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
Format, Lint, govulncheck, and gosec now run and surface findings as workflow annotations without failing the check, so the PR isn't red on pre-existing findings while the real gates (Build/Vet/Test/Tidy) stay blocking. CodeQL reports to the Security tab; Dependency Review blocks new high-severity CVEs.
- Fix pre-existing 'using resp before checking for errors' (httpresponse vet check) in kubernetes/handlers_http_test.go: check the Do() error before deferring resp.Body.Close() (4 sites). - Combine Build and Vet into one job so 'go vet' reuses the compile cache 'go build' just populated, instead of a standalone 'go vet ./...' that recompiles the whole module (~4-5 min). Test stays a parallel job.
setup-go's built-in cache keys on an exact go.sum hash, so every branch that adds a dependency gets a cold cache and recompiles the whole cloud-SDK tree (~4-5 min). Switch to actions/cache with a restore-keys fallback (go-<os>-*) so a changed go.sum still restores the previous build cache and only the changed deps recompile — repeat/PR runs drop to ~1-2 min.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #246.
The repo had no CI. Adds
.github/workflows/ci.yml:go build/vet/test ./...on Go 1.25, with module caching, on push todevelopment/masterand every PR.continue-on-error: truefor now, since lint was never enforced in CI and would otherwise red every PR on pre-existing findings. Flip it blocking after a lint-cleanup pass.This workflow runs on this PR, so its own green check validates it.