Skip to content

Commit ad5dba3

Browse files
committed
ci: add non-gating Codecov coverage job
Add an additive, non-required coverage job to ci.yml that runs cargo llvm-cov over the workspace and uploads to Codecov, plus an informational codecov.yml and a README coverage badge. The job mirrors the reusable plugin-ci setup (sibling busbarAI checkout for the path deps, WireMock service container + BUSBAR_TEST_WIREMOCK_URL) so the live GitHub-OAuth e2e is covered. Nothing depends on the job and the upload uses fail_ci_if_error: false, so it can never gate CI.
1 parent edfb39c commit ad5dba3

3 files changed

Lines changed: 97 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,76 @@ jobs:
2424
# The 1.5.2 auth ABI v2 + hosted GET /auth/token login flow live on busbar `dev` (the release
2525
# candidate), not yet `main` — build the sibling against dev so the plugin + its live e2e compile
2626
# and run. Flip back to the default (main) once 1.5.2 ships. (See .busbar-ref's placeholder note.)
27+
28+
# COVERAGE — an instrumented run of this plugin's own workspace suite, uploaded to Codecov for the
29+
# README badge and per-PR line-coverage context. Deliberately ADDITIVE and NON-GATING:
30+
#
31+
# * It is a SEPARATE job that the reusable `ci` call above does NOT depend on, and nothing depends
32+
# on it, so it is never a required check and can never turn dev/qa/main red. Coverage reporting
33+
# is an OBSERVATION, not a correctness gate — the gate is the reusable plugin-ci `ci` job, which
34+
# this must never be able to mask or block.
35+
# * `cargo llvm-cov` compiles with `-C instrument-coverage` and drops `*.profraw` files; keeping it
36+
# out of the reusable pipeline avoids perturbing that pipeline's own build/signoff steps.
37+
# * The upload uses `fail_ci_if_error: false`, so a Codecov outage or a tokenless rate-limit is a
38+
# no-op here, never a red job — a reporting dependency must never fail the build.
39+
# * FULL TIER ONLY — the same `if:` guard the core busbar repo's own coverage job uses: it runs on
40+
# every PR and on push to main/dev/qa, so a feature-branch push does not pay for a full
41+
# instrumented rebuild.
42+
#
43+
# It MIRRORS the reusable workflow's plugin + sibling-busbarAI dual checkout — the Cargo path deps
44+
# (`../../busbarAI/crates/...`) require busbar checked out as a sibling directory named `busbarAI`,
45+
# so the workspace can compile at all — and the `service: wiremock` container + BUSBAR_TEST_WIREMOCK_URL,
46+
# so tests/e2e.rs' live GitHub-OAuth GET flow is covered here too rather than skipped.
47+
coverage:
48+
name: coverage (llvm-cov · codecov)
49+
runs-on: ubuntu-latest
50+
if: github.event_name != 'push' || contains(fromJSON('["refs/heads/main", "refs/heads/dev", "refs/heads/qa"]'), github.ref)
51+
services:
52+
# Ready-made WireMock — the GitHub-OAuth token/user/orgs endpoints for tests/e2e.rs. Same
53+
# digest-pinned image the reusable plugin-ci workflow boots for this repo's `service: wiremock`
54+
# arm; no Docker health-cmd (the image has no curl/wget), the test polls /__admin for readiness.
55+
wiremock:
56+
image: wiremock/wiremock:3.9.2@sha256:d13997cd7b52583528a766019cfe7d4e91c4d224a67bdaa6f60efbb532f32176
57+
ports:
58+
- 8080:8080
59+
steps:
60+
- name: Checkout the plugin
61+
uses: actions/checkout@v7
62+
with:
63+
path: plugin
64+
# Sibling busbar checkout the plugin's local path dependencies resolve against — busbar `dev`,
65+
# matching the reusable `ci` job's busbar_ref for this repo's dev branch (the 1.5.2 RC engine the
66+
# plugin + its live e2e are built against).
67+
- name: Checkout busbar (sibling path dependency)
68+
uses: actions/checkout@v7
69+
with:
70+
repository: GetBusbar/busbar
71+
ref: dev
72+
path: busbarAI
73+
- name: Install Rust toolchain
74+
uses: dtolnay/rust-toolchain@stable
75+
with:
76+
components: llvm-tools-preview
77+
- name: Cache cargo
78+
uses: Swatinem/rust-cache@v2
79+
with:
80+
# Both checkouts use `path:`, so the two Cargo workspaces live at plugin/ and busbarAI/,
81+
# not at the checkout root — `workspaces:` must name them or the cache is a silent total miss.
82+
workspaces: |
83+
plugin
84+
busbarAI
85+
- name: Install cargo-llvm-cov
86+
uses: taiki-e/install-action@cargo-llvm-cov
87+
- name: Collect coverage (workspace, live GitHub-OAuth e2e wired to WireMock)
88+
working-directory: plugin
89+
env:
90+
# Present ⇒ tests/e2e.rs RUNS the real GET flow against the WireMock container above; absent
91+
# it would SKIP loudly. Mirrors the reusable workflow's cargo test env for `service: wiremock`.
92+
BUSBAR_TEST_WIREMOCK_URL: http://127.0.0.1:8080
93+
run: cargo llvm-cov --workspace --locked --lcov --output-path "$GITHUB_WORKSPACE/lcov.info"
94+
- name: Upload to Codecov (tokenless; never fails the build)
95+
uses: codecov/codecov-action@v5
96+
with:
97+
files: lcov.info
98+
slug: GetBusbar/auth-github
99+
fail_ci_if_error: false

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<!-- SPDX-License-Identifier: Apache-2.0 -->
22
# busbar-auth-github
33

4+
<a href="https://codecov.io/gh/GetBusbar/auth-github"><img src="https://codecov.io/gh/GetBusbar/auth-github/branch/dev/graph/badge.svg" alt="Coverage"></a>
5+
46
**GitHub-OAuth login for busbar** — a login-capable auth plugin (auth ABI v2, 1.5.2
57
token-exchange). A user signs in with GitHub; busbar establishes their identity as
68
`github:<login>` with `github:org/<org>` group memberships, then resolves those groups to policy

codecov.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Codecov is INFORMATIONAL here, never a gate. The correctness gate is the reusable plugin-ci `ci`
2+
# job; coverage is an observation surfaced on the README badge and as per-PR context. So:
3+
# * status.*.informational: true → Codecov posts a check for visibility but it is NEVER "failing",
4+
# so it can never block a PR or turn a branch red over a coverage delta.
5+
# * comment: false → no bot comments on PRs; the signal lives on the badge + the
6+
# Codecov UI, keeping PRs seamless.
7+
# * ignore → exclude test-only paths so the reported percentage reflects the
8+
# shipped plugin code, not the live-e2e / unit-test harnesses.
9+
coverage:
10+
status:
11+
project:
12+
default:
13+
informational: true
14+
patch:
15+
default:
16+
informational: true
17+
18+
comment: false
19+
20+
ignore:
21+
- "**/tests"
22+
- "**/tests/**"

0 commit comments

Comments
 (0)