ci: add golangci-lint job and composite action#2
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces GolangCI-Lint to the project and refactors the CI workflow by extracting reusable composite actions for linting and testing.
- Adds comprehensive GolangCI-Lint configuration with multiple linters enabled
- Extracts lint and unit-test workflows into reusable composite GitHub Actions
- Restructures the CI workflow to run linting before tests with proper job dependencies
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
.golangci.yml |
New linter configuration defining enabled linters, settings, and exclusion rules |
.github/actions/lint/action.yml |
New composite action for running GolangCI-Lint with caching |
.github/actions/unit-tests/action.yml |
New composite action for running Go unit tests with coverage |
.github/workflows/ci.yml |
Refactored to use composite actions, added lint job, removed matrix strategy |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…kout, honor working-directory
ykhdr
commented
Nov 10, 2025
Owner
Author
ykhdr
left a comment
There was a problem hiding this comment.
Addressed review feedback:
- Disabled gocyclo and gofumpt in
.golangci.ymland removed their settings to avoid confusion (per request). - Removed redundant
actions/checkoutfrom both composite actions; calling workflow performs checkout. - Honored
inputs.working-directoryin both actions:lint: passedworking-directorytogolangci-lint-actionand to the Go cache step.unit-tests: setworking-directoryfor the test run and fixed spacing in expressions; also adjusted artifact path.
Notes:
golangci-lint-actionsupportsversion,args, andworking-directoryinputs; workflow already grantspull-requests: writefor annotations.- If you prefer to keep checkout inside actions (for standalone reuse), we can revert and remove the workflow-level checkout instead.
Let me know if you prefer different linter set or stricter rules, I can tune revive/gocritic accordingly.
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.
This PR introduces GolangCI-Lint into the CI pipeline.
Changes:
.github/actions/lintnow usinggolangci/golangci-lint-action@v5for inline PR annotations.ci.ymlworkflow: addedlintjob with permissions to write PR comments, unit tests depend on lint..golangci.ymlconfiguration with a pragmatic baseline of linters.Next steps (optional):
fieldalignmentanddepguardlater.Let me know if you'd like further adjustments.