From 70e9e0be55a6828fa4f4e0818c268e9724a4fea6 Mon Sep 17 00:00:00 2001 From: bronachfalls Date: Fri, 18 Sep 2026 14:03:11 +0100 Subject: [PATCH] Add Codecov upload to module_ci reusable workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Exposes CODECOV_TOKEN in the spec job env and adds a codecov upload step after tests run. The upload is gated to ubuntu-latest + ruby 3.2 (matching the gem_ci.yml pattern) to avoid duplicate uploads across matrix legs. Repos without CODECOV_TOKEN set are unaffected — the step is skipped silently. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/module_ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/module_ci.yml b/.github/workflows/module_ci.yml index 5e394e1..aca1d72 100644 --- a/.github/workflows/module_ci.yml +++ b/.github/workflows/module_ci.yml @@ -111,6 +111,7 @@ jobs: # for repos that don't set it, in which case the Gemfile falls back to puppetcore. PUPPET_GEM_SOURCE: ${{ secrets.PUPPET_GEM_SOURCE }} TWINGATE_PUBLIC_REPO_KEY: ${{ secrets.TWINGATE_PUBLIC_REPO_KEY }} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} steps: - name: "Checkout" @@ -185,3 +186,15 @@ jobs: - name: "Run tests" run: | bundle exec rake parallel_spec + + - name: "Upload coverage reports to Codecov" + if: | + inputs.runs_on == 'ubuntu-latest' && + matrix.ruby_version == '3.2' && + env.CODECOV_TOKEN != '' + uses: "codecov/codecov-action@v4" + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage/.resultset.json + fail_ci_if_error: true + verbose: true