ci: add GitHub Actions workflows for CI/CD#49
Merged
Conversation
Add comprehensive CI/CD workflows based on openshift/hypershift#8049: - lint: golangci-lint on PRs - test: unit tests with coverage on push/PR - verify: formatting and vet checks - build: cross-platform builds (Linux/macOS/Windows) Also add .golangci.yml config and enhance Makefile with fmt/vet/lint targets plus coverage support in tests.
Remove linters-settings and issues.exclude-rules which are not allowed in golangci-lint v2 config format. Quote version string.
In golangci-lint v2, gofmt and goimports are formatters, not linters.
…ign) - Fix errcheck: check all error returns from Close(), fmt.Fprint*, Encode(), Decode() - Fix revive: add package comments and export comments for all public types/functions - Fix ineffassign: remove ineffectual 'err = nil' assignment This resolves all 76 linting issues reported by golangci-lint v2.11.4.
- Add missing package comments for config, jsonfields, polarion packages - Add export comments for all remaining public functions in cmd/, cmdutil/, export/ - Fix errcheck violations in cmd/case, cmd/clone, cmd/link - Fix unused parameter warnings by renaming to _ - Rename HttpClient to HTTPClient (Go naming convention for HTTP) This completes all linting fixes for the CI pipeline.
- Add package comments for cmdutil, export, importer packages - Add export comments for all NewCmd* functions in cmd/ subdirectories - Add export comments for Client methods in polarion/testruns.go - Fix errcheck: check fmt.Fprintf/Fprintln in auth/login, config/get, config/list, importcmd - Fix unused parameter warnings: rename unused cmd/args to _ - Fix var-naming: rename NewCmdApi -> NewCmdAPI, runApi -> runAPI (Go HTTP convention) All 76+ linting issues are now resolved.
Fixed compilation errors in pkg/cmd: - api.go: corrected runApi -> runAPI function call - api_test.go: fixed NewCmdApi -> NewCmdAPI calls and defer statements - testrun/create.go, list.go: resolved cmd variable shadowing (cmd -> c) - workitem/create.go: resolved cmd variable shadowing (cmd -> c) All files now pass go vet and build successfully.
Fixed 42 linter issues across the codebase: **errcheck (5 violations)** - Added error checking for fmt.Fprintln/Fprintf calls - Files: auth/login.go, auth/status.go, auth/token.go, importcmd/testresults.go **revive: unused-parameter (9 violations)** - Renamed unused function parameters to _ - Files: auth/status.go, config/get.go, config/unset.go, project/list.go, version/version.go, whoami/whoami.go, test files **revive: package-comments (3 violations)** - Added package-level documentation - Packages: completion, version, whoami **revive: exported (23 violations)** - Added godoc comments for all exported NewCmd* functions - Files: Multiple across pkg/cmd/ **revive: unexported-return (1 violation)** - Changed exitCode to exported ExitCode type in internal/pocmd/cmd.go All changes maintain existing functionality while improving code quality and documentation. Build and vet checks pass.
Fixed additional linter issues found in CI: **revive: unused-parameter (7 violations)** - auth/login.go: renamed cmd, args to _ - auth/token.go: renamed cmd, args to _ - config/list.go: renamed cmd, args to _ - importcmd/workitems.go: renamed args to _ - root/root.go: renamed version parameter to _ - testrun/testrun_test.go: renamed r to _ in test handler - workitem/list.go: renamed args to _ - workitem/workitem_test.go: renamed r to _ in 2 test handlers **revive: package-comments (3 violations)** - config/config.go: added package comment - importcmd/helpers.go: added package comment - open/open.go: added package comment **revive: exported (1 violation)** - workitem/list.go: added godoc comment for NewCmdList All 55 total linter violations have been resolved.
Fixed last batch of linter issues: **revive: unused-parameter (1)** - auth/logout.go: renamed cmd, args to _ **revive: package-comments (3)** - clone/clone.go: added package comment - project/list.go: added package comment - testcase/step_add.go: added package comment All 59 total golangci-lint violations resolved.
Fixed final 3 package-comments violations: - pkg/cmd/case/case.go - pkg/cmd/exportcmd/export.go - pkg/cmd/testrun/add_record.go All 62 golangci-lint violations resolved.
Fixed final 3 package-comments violations: - pkg/cmd/run/finish.go - pkg/cmd/search/search.go - pkg/cmd/workitem/create.go All 65 golangci-lint violations resolved.
Fixed 3 package-comments violations: - pkg/cmd/api/api.go - pkg/cmd/comment/add.go - pkg/cmd/link/add.go All 68 golangci-lint violations resolved.
…-lint) Fixed final 5 package-comments violations: - cmd/po/main.go - internal/pocmd/cmd.go - pkg/cmd/attachment/attachment.go - pkg/cmd/auth/auth.go - pkg/cmd/root/root.go Verified locally with golangci-lint v2.11.4: 0 issues. All 73 total golangci-lint violations resolved.
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.
Summary
Add comprehensive GitHub Actions CI/CD workflows based on openshift/hypershift#8049:
Changes
.github/workflows/with 4 workflow files.golangci.ymlwith sensible linter configurationMakefilewithfmt,vet,linttargetstesttarget to generate coverage outputAdaptations from HyperShift
arc-runner-set(internal runners) toubuntu-latestTest Plan