From f11d3f48a3eb7f6d7d46d7108cc24ce0ae0081b2 Mon Sep 17 00:00:00 2001 From: Dwi Siswanto Date: Thu, 3 Dec 2026 09:17:42 +0700 Subject: [PATCH 1/2] ci: move lint job to reusable golangci-lint workflow 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. Point the README badge at tests.yml. tests.yml now runs only for pull requests and pushes to main that change a .go or .mod file. Before, every pull request and every push to any branch ran lint and the build job, so a push to a pull request's branch ran them twice. The lint timeout goes from 5m to the workflow's default of 30m. Closes: #37 Signed-off-by: Dwi Siswanto --- .github/workflows/lint-test.yml | 23 ------------------- .../workflows/{build-test.yml => tests.yml} | 20 ++++++++++++++-- README.md | 2 +- 3 files changed, 19 insertions(+), 26 deletions(-) delete mode 100644 .github/workflows/lint-test.yml rename .github/workflows/{build-test.yml => tests.yml} (55%) diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml deleted file mode 100644 index 8993d62..0000000 --- a/.github/workflows/lint-test.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: 🙏🏻 Lint Test -on: - push: - pull_request: - workflow_dispatch: - -jobs: - lint: - name: Lint Test - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v7 - - name: Set up Go - uses: actions/setup-go@v7 - with: - go-version: 1.18 - - name: Run golangci-lint - uses: golangci/golangci-lint-action@v9.3.0 - with: - version: latest - args: --timeout 5m - working-directory: . diff --git a/.github/workflows/build-test.yml b/.github/workflows/tests.yml similarity index 55% rename from .github/workflows/build-test.yml rename to .github/workflows/tests.yml index 5f0939b..8f99bea 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/tests.yml @@ -1,13 +1,29 @@ -name: 🔨 Build Test +name: 🔨 Tests on: - push: pull_request: + paths: + - '**.go' + - '**.mod' + push: + branches: + - main + paths: + - '**.go' + - '**.mod' workflow_dispatch: jobs: + lint: + name: Lint Test + uses: projectdiscovery/workflows/.github/workflows/golangci-lint.yaml@v1 + permissions: + contents: read + pull-requests: read + build: name: Test Builds + needs: [lint] runs-on: ubuntu-latest steps: - name: Set up Go diff --git a/README.md b/README.md index 74189a7..7b95ee1 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![License](https://img.shields.io/github/license/projectdiscovery/roundrobin)](LICENSE.md) ![Go version](https://img.shields.io/github/go-mod/go-version/projectdiscovery/roundrobin?filename=go.mod) [![Release](https://img.shields.io/github/release/projectdiscovery/roundrobin)](https://github.com/projectdiscovery/roundrobin/releases/) -[![Checks](https://github.com/projectdiscovery/roundrobin/actions/workflows/build-test.yml/badge.svg)](https://github.com/projectdiscovery/roundrobin/actions/workflows/build-test.yml) +[![Checks](https://github.com/projectdiscovery/roundrobin/actions/workflows/tests.yml/badge.svg)](https://github.com/projectdiscovery/roundrobin/actions/workflows/tests.yml) [![GoDoc](https://pkg.go.dev/badge/projectdiscovery/roundrobin)](https://pkg.go.dev/github.com/projectdiscovery/roundrobin) From b9dea2efd6ee9c91031c8f0d4b1bcca3bfefe591 Mon Sep 17 00:00:00 2001 From: Dwi Siswanto Date: Thu, 3 Dec 2026 17:21:21 +0700 Subject: [PATCH 2/2] ci: run tests when tests.yml changes 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: #37 Signed-off-by: Dwi Siswanto --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8f99bea..f80a550 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,12 +4,14 @@ on: paths: - '**.go' - '**.mod' + - '.github/workflows/tests.yml' push: branches: - main paths: - '**.go' - '**.mod' + - '.github/workflows/tests.yml' workflow_dispatch: