Files
nvke/.github/workflows/coverage.yml
dependabot[bot] 95b9c02956 build: bump the github-actions group across 2 directories with 9 updates (#2446)
Bumps the github-actions group with 9 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [actions/setup-go](https://github.com/actions/setup-go) | `7.0.0` | `7.1.0` |
| [oras-project/setup-oras](https://github.com/oras-project/setup-oras) | `2.0.3` | `2.0.4` |
| [github/codeql-action/init](https://github.com/github/codeql-action) | `4.39.3` | `4.39.4` |
| [github/codeql-action/analyze](https://github.com/github/codeql-action) | `4.39.3` | `4.39.4` |
| [actions/dependency-review-action](https://github.com/actions/dependency-review-action) | `5.0.0` | `5.0.1` |
| [github/codeql-action/upload-sarif](https://github.com/github/codeql-action) | `4.39.3` | `4.39.4` |
| [actions/create-github-app-token](https://github.com/actions/create-github-app-token) | `3.3.0` | `3.4.0` |
| [amannn/action-semantic-pull-request](https://github.com/amannn/action-semantic-pull-request) | `6.1.2` | `6.1.3` |
| [ossf/scorecard-action](https://github.com/ossf/scorecard-action) | `2.5.0` | `2.6.0` |

Bumps the github-actions group with 1 update in the /.github/actions/malware-scan directory: [github/codeql-action/upload-sarif](https://github.com/github/codeql-action).


Updates `actions/setup-go` from 7.0.0 to 7.1.0
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/b7ad1dad31e06c5925ef5d2fc7ad053ef454303e...d8cbb8045d7f43706b9177cceb36c1f91a6644d5)

Updates `oras-project/setup-oras` from 2.0.3 to 2.0.4
- [Release notes](https://github.com/oras-project/setup-oras/releases)
- [Commits](https://github.com/oras-project/setup-oras/compare/5e2f2482b30b0cb3e14e67f89a80c88c659a7c63...ac735097e22fe643015b0d19645f7c9a69942128)

Updates `github/codeql-action/init` from 4.39.3 to 4.39.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/33d7b85da1a04171e211befe2c739303b9a4c066...1bd86f2fdb4b86187fa4059f16f31a3202acc9ea)

Updates `github/codeql-action/analyze` from 4.39.3 to 4.39.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/33d7b85da1a04171e211befe2c739303b9a4c066...1bd86f2fdb4b86187fa4059f16f31a3202acc9ea)

Updates `actions/dependency-review-action` from 5.0.0 to 5.0.1
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](https://github.com/actions/dependency-review-action/compare/a1d282b36b6f3519aa1f3fc636f609c47dddb294...bbc44d14a204704ccc493733616cd1e93a0321ec)

Updates `github/codeql-action/upload-sarif` from 4.39.3 to 4.39.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/33d7b85da1a04171e211befe2c739303b9a4c066...1bd86f2fdb4b86187fa4059f16f31a3202acc9ea)

Updates `actions/create-github-app-token` from 3.3.0 to 3.4.0
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Changelog](https://github.com/actions/create-github-app-token/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/create-github-app-token/compare/64ab729a6294000f5aa4a4bc0b73d1f32bc45510...f418cff399f7aef4c2f0ad47e25ca7a6abbdd6fc)

Updates `amannn/action-semantic-pull-request` from 6.1.2 to 6.1.3
- [Release notes](https://github.com/amannn/action-semantic-pull-request/releases)
- [Changelog](https://github.com/amannn/action-semantic-pull-request/blob/main/CHANGELOG.md)
- [Commits](https://github.com/amannn/action-semantic-pull-request/compare/2252a14e810aa9b85c2d560bd7070c802206ecf6...c5e23b7e584519ee15caa684cf60d056aa9f035f)

Updates `ossf/scorecard-action` from 2.5.0 to 2.6.0
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/fa7117db83c52d787ae5a89f350999701505d78e...23f22cd43608bae7a1f1fa2603d7314dee9538a5)

Updates `github/codeql-action/upload-sarif` from 4.39.3 to 4.39.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/33d7b85da1a04171e211befe2c739303b9a4c066...1bd86f2fdb4b86187fa4059f16f31a3202acc9ea)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-version: 7.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: oras-project/setup-oras
  dependency-version: 2.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action/init
  dependency-version: 4.39.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.39.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: actions/dependency-review-action
  dependency-version: 5.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action/upload-sarif
  dependency-version: 4.39.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: actions/create-github-app-token
  dependency-version: 3.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: amannn/action-semantic-pull-request
  dependency-version: 6.1.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: ossf/scorecard-action
  dependency-version: 2.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: github/codeql-action/upload-sarif
  dependency-version: 4.39.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-30 10:13:01 -07:00

165 lines
7.1 KiB
YAML

# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Coverage collection across the nine modules that have tests.
#
# Three of them collected a profile before this existed and six did not, and
# nothing read any of it: controller/Makefile wrote coverage.txt and said so in
# a comment, nico-sim and management-engine wrote their own, and no workflow,
# service or threshold touched any of them. A profile nobody reads is close to
# no profile. No profile at all is worse -- there is then nothing to notice when
# a build tag quietly stops compiling a suite, because the run still passes and
# nothing goes red.
#
# READ docs/coverage-policy.md BEFORE WIRING A NUMBER INTO ANYTHING HERE. A
# percentage measures which lines a test binary executed, not whether anything
# was asserted about them. Nothing in this file fails on one, deliberately. What
# does fail: a missing, malformed or empty profile, and a package that holds
# tests and is not being run.
#
# TWO JOBS, BECAUSE THEY COST DIFFERENT AMOUNTS
#
# `policy` reads the registry against the tree. No test run, no Go build, about
# a second. It is a merge-gate member, and it is the half that catches the
# drift: a new module that collects nothing, a module that gains its first test
# and does not start collecting, a test recipe that loses its -coverprofile.
#
# `report` runs the nine suites and summarises them. That duplicates work the
# gate's own test lanes already do, so it does NOT run on a pull request -- the
# `if` below skips it when this workflow is called, and the gate tolerates a
# skipped job. It runs on main, on a schedule and on demand, which is where a
# trend is read from anyway. Making it a gate member would roughly double the
# gate's wall clock to re-measure what controller-test.yml, agent-test.yml and
# go-build.yml have already run.
name: Coverage
# workflow_call is what merge-gate.yml uses to call this as a reusable workflow,
# for the `policy` job only. A called workflow does not apply its own `paths:`
# filter, so on a pull request this runs whatever changed; the filter below
# still applies to `push`.
on:
push:
branches: [main]
paths:
- '**.go'
- '**/go.mod'
- '**/go.sum'
- '**/Makefile'
- 'make/coverage.mk'
- 'go.work'
- 'go.work.sum'
- 'hack/coverage.sh'
- '.github/workflows/coverage.yml'
# Weekly, so the trend survives a quiet week on main and so a profile that
# only breaks on a cold cache is found by something other than a release.
schedule:
- cron: '25 6 * * 1'
workflow_call:
workflow_dispatch: {}
permissions: {}
concurrency:
# The sha is part of the group on main, so every commit gets its own.
# Without it, back-to-back merges lose CI results: GitHub allows one running
# and one pending run per group, and cancels the pending one when a third
# arrives -- whatever cancel-in-progress says.
#
# A literal name, NOT ${{ github.workflow }}. Inside a called workflow that
# expression is the CALLER's name, so every workflow merge-gate.yml calls
# would compute the same group and cancel each other.
group: Coverage-${{ github.ref }}-${{ github.ref == 'refs/heads/main' && github.sha || '' }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
# A module fetch the proxy drops mid-stream falls back to the module's origin (#1481).
env:
GOPROXY: https://proxy.golang.org|direct
jobs:
policy:
name: Check the coverage registry
runs-on: ubuntu-latest
if: github.repository_id == '1323115536'
timeout-minutes: 5
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# `make coverage-check` parses go.work and greps Makefiles. It runs no Go
# and needs no toolchain, which is the whole point of splitting it out.
- name: Verify every module is classified and still collecting
run: make coverage-check
report:
name: Collect and report
# Skipped when merge-gate.yml calls this on a pull request: in a called
# workflow github.event_name is the CALLER's event, so `push`, `schedule`
# and `workflow_dispatch` are the three that are really this workflow's
# own. See the header for why the gate does not pay for this job.
if: >-
github.repository_id == '1323115536' &&
(github.event_name == 'push' ||
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch')
runs-on: ubuntu-latest
# Nine suites in sequence, with the race detector on. controller alone is
# the better part of ten minutes on a cold module cache.
timeout-minutes: 60
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Workspace mode (default) so every module resolves the root module
# graph. go.work carries the toolchain that satisfies all of them.
- name: Set up Go
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version-file: go.work
cache: true
# go.work.sum holds only the hashes not already in a member's go.sum,
# so keyed on it alone a dependency bump restores a stale cache.
cache-dependency-path: |
go.work.sum
**/go.sum
# ⚠️ CGO_ENABLED=1 is required and this job does not work without it.
# #116 replaced modernc.org/sqlite (pure Go) with mattn/go-sqlite3, a cgo
# binding that compiles to a stub failing at the first query rather than
# at build time. Eight controller packages fail with "requires cgo to
# work. This is a stub" without it. See controller-test.yml.
#
# -race, to match what the gate's lanes measure. A profile collected from
# a different build of the same suite is a different measurement, and the
# point of the table is that it is comparable between runs.
- name: Run every collecting module's tests
env:
CGO_ENABLED: "1"
GO_TEST_FLAGS: -race
run: make coverage
# Unconditionally: a failed run is exactly when someone wants to look at
# the profiles that were produced before it stopped.
- name: Upload the coverage profiles
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: coverage-profiles
path: coverage/
# 30, not the default 90. The schedule above supersedes this
# measurement weekly, so two months of superseded profiles is storage
# spent on nothing anyone will open. The table in the job summary has
# no retention and outlives the artifact either way.
retention-days: 30
# An empty directory means the run failed before any suite finished,
# which the step above already reported. Do not add a second error.
if-no-files-found: warn