Skip to content

ci: move lint job to reusable golangci-lint workflow - #19

Open
dwisiswant0 wants to merge 2 commits into
mainfrom
dwisiswant0/ci/move-lint-job-to-reusable-golangci-lint-workflow
Open

dwisiswant0 wants to merge 2 commits into
mainfrom
dwisiswant0/ci/move-lint-job-to-reusable-golangci-lint-workflow

Conversation

@dwisiswant0

@dwisiswant0 dwisiswant0 commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Replace lint-test.yml with a lint job in build-test.yml that calls
golangci-lint.yaml, the reusable workflow in projectdiscovery/workflows.
On pull requests it reports only issues on lines the pull request
changes, so a pull request no longer fails on issues it didn't add, such
as ones a new golangci-lint release starts reporting. Push and manual
runs lint the whole module.

The build job now needs lint and doesn't run when lint fails.

Rename build-test.yml to tests.yml and the workflow from Build Test to
Tests, matching dsl's lint and test workflow.

tests.yml now also runs on push to main. A cache saved by a pull_request
run is visible only to that pull request, so the Go and golangci-lint
caches never carried over from one pull request to the next. A push run
saves them on main, where every pull request can restore them. Pull
requests and pushes now run it only when they change a .go or .mod file;
before, every pull request ran lint and the build job.

Lint now uses the Go version in go.mod, 1.19, instead of the pinned
1.20.x. The lint timeout goes from 5m to the workflow's default of 30m.

tests.yml also runs when tests.yml itself changes, so this pull request runs the new lint job.

Closes: #18

Replace lint-test.yml with a lint job in build-test.yml that calls
golangci-lint.yaml, the reusable workflow in projectdiscovery/workflows.
On pull requests it reports only issues on lines the pull request
changes, so a pull request no longer fails on issues it didn't add, such
as ones a new golangci-lint release starts reporting. Push and manual
runs lint the whole module.

The build job now needs lint and doesn't run when lint fails.

Rename build-test.yml to tests.yml and the workflow from Build Test to
Tests, matching dsl's lint and test workflow.

tests.yml now also runs on push to main. A cache saved by a pull_request
run is visible only to that pull request, so the Go and golangci-lint
caches never carried over from one pull request to the next. A push run
saves them on main, where every pull request can restore them. Pull
requests and pushes now run it only when they change a .go or .mod file;
before, every pull request ran lint and the build job.

Lint now uses the Go version in go.mod, 1.19, instead of the pinned
1.20.x. The lint timeout goes from 5m to the workflow's default of 30m.

Closes: #18
Signed-off-by: Dwi Siswanto <git@dw1.io>
@dwisiswant0 dwisiswant0 self-assigned this Dec 3, 2026
@dwisiswant0
dwisiswant0 requested a review from Mzack9999 December 3, 2026 02:44
The paths filters matched only Go and module files, so a change
to the workflow itself, including this pull request, never ran
it. Add tests.yml to both lists.

Refs: #18
Signed-off-by: Dwi Siswanto <git@dw1.io>
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.

Move the lint job to the reusable golangci-lint workflow

1 participant