Skip to content

ci: add golangci-lint job and composite action#2

Merged
ykhdr merged 9 commits intomasterfrom
feature/ci-workflow
Nov 10, 2025
Merged

ci: add golangci-lint job and composite action#2
ykhdr merged 9 commits intomasterfrom
feature/ci-workflow

Conversation

@ykhdr
Copy link
Owner

@ykhdr ykhdr commented Nov 10, 2025

This PR introduces GolangCI-Lint into the CI pipeline.

Changes:

  • Added composite action .github/actions/lint now using golangci/golangci-lint-action@v5 for inline PR annotations.
  • Updated ci.yml workflow: added lint job with permissions to write PR comments, unit tests depend on lint.
  • Added .golangci.yml configuration with a pragmatic baseline of linters.
  • Semantics comments added to clarify purpose of changes.

Next steps (optional):

  • Extend lint job to upload artifacts only when needed.
  • Tune revive and gocritic rules once code style stabilizes.
  • Consider enabling fieldalignment and depguard later.

Let me know if you'd like further adjustments.

@ykhdr ykhdr requested a review from Copilot November 10, 2025 06:10
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Owner Author

@ykhdr ykhdr left a comment

Choose a reason for hiding this comment

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

Addressed review feedback:

  • Disabled gocyclo and gofumpt in .golangci.yml and removed their settings to avoid confusion (per request).
  • Removed redundant actions/checkout from both composite actions; calling workflow performs checkout.
  • Honored inputs.working-directory in both actions:
    • lint: passed working-directory to golangci-lint-action and to the Go cache step.
    • unit-tests: set working-directory for the test run and fixed spacing in expressions; also adjusted artifact path.

Notes:

  • golangci-lint-action supports version, args, and working-directory inputs; workflow already grants pull-requests: write for 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.

@ykhdr ykhdr merged commit 4b0a916 into master Nov 10, 2025
4 checks passed
@ykhdr ykhdr deleted the feature/ci-workflow branch November 10, 2025 06:23
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