From b9747388a4b799b6cc343bc5f0f3843a944b6a9a 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. tests.yml now also runs on push to dev. 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 dev, where every pull request can restore them. Closes: #234 Signed-off-by: Dwi Siswanto --- .github/workflows/lint-test.yml | 17 ----------------- .github/workflows/{build-test.yml => tests.yml} | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 18 deletions(-) delete mode 100644 .github/workflows/lint-test.yml rename .github/workflows/{build-test.yml => tests.yml} (60%) diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml deleted file mode 100644 index fe56a0d..0000000 --- a/.github/workflows/lint-test.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: 🙏🏻 Lint Test - -on: - pull_request: - paths: - - '**.go' - - '**.mod' - workflow_dispatch: - -jobs: - lint: - name: Lint Test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v7 - - uses: projectdiscovery/actions/setup/go@v1 - - uses: projectdiscovery/actions/golangci-lint/v2@v1 \ No newline at end of file diff --git a/.github/workflows/build-test.yml b/.github/workflows/tests.yml similarity index 60% rename from .github/workflows/build-test.yml rename to .github/workflows/tests.yml index 687255d..7e1e69d 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/tests.yml @@ -1,16 +1,30 @@ -name: 🔨 Build Test +name: 🔨 Tests on: pull_request: paths: - '**.go' - '**.mod' + push: + branches: + - dev + 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: - uses: actions/checkout@v7 From 78cffa1dbc1a4dd5973ae96705d41872c519f965 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: #234 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 7e1e69d..37f1448 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,12 +5,14 @@ on: paths: - '**.go' - '**.mod' + - '.github/workflows/tests.yml' push: branches: - dev paths: - '**.go' - '**.mod' + - '.github/workflows/tests.yml' workflow_dispatch: