From 57efb968fc54e0fb4acce30a1c4d7fa4b2be033b Mon Sep 17 00:00:00 2001 From: "Joel Rosental R." Date: Tue, 20 Jan 2026 00:15:40 +0100 Subject: [PATCH 01/11] Split test-with-coverage.yml workflow in two pieces: ci-pr (untrusted) and ci-coverage (trusted) --- .github/workflows/ci-coverage.yml | 25 +++++++++++++ .github/workflows/ci-pr.yml | 33 +++++++++++++++++ .github/workflows/test-with-coverage.yml | 45 ------------------------ 3 files changed, 58 insertions(+), 45 deletions(-) create mode 100644 .github/workflows/ci-coverage.yml create mode 100644 .github/workflows/ci-pr.yml delete mode 100644 .github/workflows/test-with-coverage.yml diff --git a/.github/workflows/ci-coverage.yml b/.github/workflows/ci-coverage.yml new file mode 100644 index 000000000..1b45befb7 --- /dev/null +++ b/.github/workflows/ci-coverage.yml @@ -0,0 +1,25 @@ +name: ci-coverage +on: + workflow_run: + workflows: [ ci-pr ] + types: [ completed ] + +jobs: + upload-coverage: + if: > + github.event.workflow_run.conclusion == 'success' + runs-on: ubuntu-24.04 + + steps: + - name: Download coverage artifact + uses: actions/download-artifact@v4 + with: + name: coverage + run-id: ${{ github.event.workflow_run.id }} + + - name: Upload to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage.txt + fail_ci_if_error: true diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml new file mode 100644 index 000000000..fdd001723 --- /dev/null +++ b/.github/workflows/ci-pr.yml @@ -0,0 +1,33 @@ +name: ci-pr +on: + pull_request: + branches: [ master ] + +jobs: + test: + runs-on: ubuntu-24.04 + + steps: + - name: Checkout PR code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install Go + uses: actions/setup-go@v6 + with: + go-version-file: go.mod + + - name: generate + run: | + make generate + + - name: Test + run: | + make test-with-coverage + + - name: Upload coverage artifact + uses: actions/upload-artifact@v4 + with: + name: coverage + path: ./build/_output/coverage/coverage.txt diff --git a/.github/workflows/test-with-coverage.yml b/.github/workflows/test-with-coverage.yml deleted file mode 100644 index 8a4611c4f..000000000 --- a/.github/workflows/test-with-coverage.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: ci-build -on: - push: - branches: - - master - tags-ignore: - - '*.*' - pull_request_target: - types: [ opened, synchronize, reopened, ready_for_review ] - branches: - - master - -jobs: - test-with-coverage: - name: Test with Coverage - runs-on: ubuntu-24.04 - steps: - - name: Checkout code - uses: actions/checkout@v6 - with: - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} - fetch-depth: 0 - - - name: Install Go - uses: actions/setup-go@v6 - with: - go-version-file: go.mod - - - name: generate - run: | - make generate - - - name: Test - run: | - make test-with-coverage - - - name: Upload code coverage - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./build/_output/coverage/coverage.txt - flags: unittests # optional - fail_ci_if_error: true # optional (default = false) - verbose: true # optional (default = false) From 9fbfc403ecdbb3f3ba2baf8949a86cc58edaf286 Mon Sep 17 00:00:00 2001 From: "Joel Rosental R." Date: Wed, 21 Jan 2026 17:50:22 +0100 Subject: [PATCH 02/11] Changing actions/upload-artifact to v6. Change names of workflows --- .github/workflows/{ci-pr.yml => test-with-coverage.yml} | 4 ++-- .github/workflows/{ci-coverage.yml => upload-coverage.yml} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{ci-pr.yml => test-with-coverage.yml} (90%) rename .github/workflows/{ci-coverage.yml => upload-coverage.yml} (100%) diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/test-with-coverage.yml similarity index 90% rename from .github/workflows/ci-pr.yml rename to .github/workflows/test-with-coverage.yml index fdd001723..c24f96bc3 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/test-with-coverage.yml @@ -1,4 +1,4 @@ -name: ci-pr +name: test-with-coverage on: pull_request: branches: [ master ] @@ -9,7 +9,7 @@ jobs: steps: - name: Checkout PR code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 diff --git a/.github/workflows/ci-coverage.yml b/.github/workflows/upload-coverage.yml similarity index 100% rename from .github/workflows/ci-coverage.yml rename to .github/workflows/upload-coverage.yml From 3b45ae67d18a84defa0cbb09156f8195a7035135 Mon Sep 17 00:00:00 2001 From: "Joel Rosental R." Date: Wed, 21 Jan 2026 17:56:26 +0100 Subject: [PATCH 03/11] Add github-token parameter to download artifact step --- .github/workflows/upload-coverage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/upload-coverage.yml b/.github/workflows/upload-coverage.yml index 1b45befb7..a0c971a9b 100644 --- a/.github/workflows/upload-coverage.yml +++ b/.github/workflows/upload-coverage.yml @@ -15,6 +15,7 @@ jobs: uses: actions/download-artifact@v4 with: name: coverage + github-token: ${{ secrets.GITHUB_TOKEN }} run-id: ${{ github.event.workflow_run.id }} - name: Upload to Codecov From 8f8944b60a6519ec471bd2b956309eebf9951fa3 Mon Sep 17 00:00:00 2001 From: "Joel Rosental R." Date: Thu, 22 Jan 2026 11:57:45 +0100 Subject: [PATCH 04/11] Update coverage.txt path --- .github/workflows/upload-coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upload-coverage.yml b/.github/workflows/upload-coverage.yml index a0c971a9b..9e75924f7 100644 --- a/.github/workflows/upload-coverage.yml +++ b/.github/workflows/upload-coverage.yml @@ -22,5 +22,5 @@ jobs: uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} - files: coverage.txt + files: build/output/coverage/coverage.txt fail_ci_if_error: true From b6df27c73e98c6157a0a55e7e6ea15b93b007fb8 Mon Sep 17 00:00:00 2001 From: "Joel Rosental R." Date: Thu, 22 Jan 2026 20:02:48 +0100 Subject: [PATCH 05/11] fix name of workflow --- .github/workflows/upload-coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upload-coverage.yml b/.github/workflows/upload-coverage.yml index 9e75924f7..88f61987a 100644 --- a/.github/workflows/upload-coverage.yml +++ b/.github/workflows/upload-coverage.yml @@ -1,7 +1,7 @@ name: ci-coverage on: workflow_run: - workflows: [ ci-pr ] + workflows: [ test-with-coverage ] types: [ completed ] jobs: From 996affd367826945fafbfcc8b59a1fe07ff2294e Mon Sep 17 00:00:00 2001 From: "Joel Rosental R." Date: Thu, 22 Jan 2026 20:03:19 +0100 Subject: [PATCH 06/11] change name of workflow --- .github/workflows/upload-coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upload-coverage.yml b/.github/workflows/upload-coverage.yml index 88f61987a..3f6f3186a 100644 --- a/.github/workflows/upload-coverage.yml +++ b/.github/workflows/upload-coverage.yml @@ -1,4 +1,4 @@ -name: ci-coverage +name: upload-coverage on: workflow_run: workflows: [ test-with-coverage ] From 425d194bbae09a9f9cc77fdc2509a9b96a0615ba Mon Sep 17 00:00:00 2001 From: "Joel Rosental R." Date: Fri, 23 Jan 2026 11:11:45 +0100 Subject: [PATCH 07/11] fix typo in upload path to codecov --- .github/workflows/upload-coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upload-coverage.yml b/.github/workflows/upload-coverage.yml index 3f6f3186a..8995d721b 100644 --- a/.github/workflows/upload-coverage.yml +++ b/.github/workflows/upload-coverage.yml @@ -22,5 +22,5 @@ jobs: uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} - files: build/output/coverage/coverage.txt + files: build/_output/coverage/coverage.txt fail_ci_if_error: true From 182ee225bfaf2714b9c5daeb3a4065881439b522 Mon Sep 17 00:00:00 2001 From: "Joel Rosental R." Date: Wed, 28 Jan 2026 17:34:47 +0100 Subject: [PATCH 08/11] Change path for uploading coverage.txt artifact --- .github/workflows/test-with-coverage.yml | 5 +++++ .github/workflows/upload-coverage.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-with-coverage.yml b/.github/workflows/test-with-coverage.yml index c24f96bc3..25061f775 100644 --- a/.github/workflows/test-with-coverage.yml +++ b/.github/workflows/test-with-coverage.yml @@ -2,6 +2,11 @@ name: test-with-coverage on: pull_request: branches: [ master ] + push: + branches: + - master + tags-ignore: + - '*.*' jobs: test: diff --git a/.github/workflows/upload-coverage.yml b/.github/workflows/upload-coverage.yml index 8995d721b..4c2d395f9 100644 --- a/.github/workflows/upload-coverage.yml +++ b/.github/workflows/upload-coverage.yml @@ -22,5 +22,5 @@ jobs: uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} - files: build/_output/coverage/coverage.txt + files: coverage/coverage.txt fail_ci_if_error: true From 48feb6cde93d847126f2998c7cd1800f3b6bba5a Mon Sep 17 00:00:00 2001 From: "Joel Rosental R." Date: Wed, 28 Jan 2026 17:42:44 +0100 Subject: [PATCH 09/11] Add flags: unittests option --- .github/workflows/upload-coverage.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/upload-coverage.yml b/.github/workflows/upload-coverage.yml index 4c2d395f9..4bb9dde00 100644 --- a/.github/workflows/upload-coverage.yml +++ b/.github/workflows/upload-coverage.yml @@ -22,5 +22,9 @@ jobs: uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} + # The 'files' attribute consists of 'coverage/coverage.txt'. + # The 'coverage' directory is created upon the download of the coverage artifact from previous step (it creates a directory with the name of the artifact). files: coverage/coverage.txt + flags: unittests # optional fail_ci_if_error: true + verbose: true From 389bc308b5cd83cd4cea9ad52078e069ba436e8d Mon Sep 17 00:00:00 2001 From: "Joel Rosental R." Date: Thu, 29 Jan 2026 09:47:07 +0100 Subject: [PATCH 10/11] Remove trailing spaces --- .github/workflows/test-with-coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-coverage.yml b/.github/workflows/test-with-coverage.yml index 25061f775..d53563385 100644 --- a/.github/workflows/test-with-coverage.yml +++ b/.github/workflows/test-with-coverage.yml @@ -35,4 +35,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: coverage - path: ./build/_output/coverage/coverage.txt + path: ./build/_output/coverage/coverage.txt From badc4431ec36ae693799693d32263c54757b2225 Mon Sep 17 00:00:00 2001 From: "Joel Rosental R." Date: Thu, 29 Jan 2026 15:48:49 +0100 Subject: [PATCH 11/11] bump download-artifact action version to v7 --- .github/workflows/upload-coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upload-coverage.yml b/.github/workflows/upload-coverage.yml index 4bb9dde00..3d1f5c6be 100644 --- a/.github/workflows/upload-coverage.yml +++ b/.github/workflows/upload-coverage.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Download coverage artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v7 with: name: coverage github-token: ${{ secrets.GITHUB_TOKEN }}