|
24 | 24 | # The 1.5.2 auth ABI v2 + hosted GET /auth/token login flow live on busbar `dev` (the release |
25 | 25 | # candidate), not yet `main` — build the sibling against dev so the plugin + its live e2e compile |
26 | 26 | # 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 |
0 commit comments