Skip to content

ci/cd: parallel CI jobs + security scanning (build, vet, test, tidy, lint, govulncheck, gosec, CodeQL, dependency-review)#261

Merged
NitinKumar004 merged 7 commits into
developmentfrom
feat/ci-github-actions
Jul 12, 2026
Merged

ci/cd: parallel CI jobs + security scanning (build, vet, test, tidy, lint, govulncheck, gosec, CodeQL, dependency-review)#261
NitinKumar004 merged 7 commits into
developmentfrom
feat/ci-github-actions

Conversation

@NitinKumar004

Copy link
Copy Markdown
Collaborator

Closes #246.

The repo had no CI. Adds .github/workflows/ci.yml:

  • build · vet · test (required) — go build/vet/test ./... on Go 1.25, with module caching, on push to development/master and every PR.
  • golangci-lint (advisory) — runs the repo's strict v2 config but continue-on-error: true for 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.

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.
@NitinKumar004 NitinKumar004 changed the title ci: add GitHub Actions (build, vet, test + advisory lint) ci/cd: parallel CI jobs + security scanning (build, vet, test, tidy, lint, govulncheck, gosec, CodeQL, dependency-review) Jul 12, 2026
@github-advanced-security

Copy link
Copy Markdown

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:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

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.
@NitinKumar004 NitinKumar004 merged commit 1086e72 into development Jul 12, 2026
10 checks passed
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.

feat: add CI (GitHub Actions) for build, vet, lint, and test on push/PR

2 participants