Replace this temporary ReportGenerator/.NET dependency with grcov
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 55/100
- Issue-Typ
- Refactoring
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- github-actions, javascript
Rechercherichtung
Start with the coverage preparation and finish logic in actions/quality/prepare-ci-reports/action.yml, including the referenced dist/index.js implementation. Check whether the specified grcov releases support the required LCOV branch counts and Cobertura and Clover inputs, then validate the existing report contract. Done when coverage normalization uses grcov in place of the ReportGenerator/.NET steps and the report contract is validated.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
after these changes are released and the report contract is validated:
https://github\.com/mozilla/grcov/pull/1568 (LCOV branch counts)
https://github\.com/mozilla/grcov/pull/1569 (Cobertura and Clover XML inputs).
v6.1.0
# Convert supported native reports with upstream tools and retain one artifact.
# Language actions call this after their command, including failures.
# See the [publication workflow](../../../.github/workflows/publish-ci-reports.md)
# for destinations, permissions, summaries and comments.
#
# ## Custom commands
#
# Run the command in its normal workflow step and prepare its reports afterwards.
# Use a fresh directory owned by that execution. The preparation step still runs
# when the command fails, so diagnostic reports remain available.
#
# ```yaml
# - id: report-directory
# shell: bash
# run: echo "path=$(mktemp -d "$RUNNER_TEMP/integration-reports.XXXXXX")" >> "$GITHUB_OUTPUT"
# - id: integration
# working-directory: application
# env:
# CI_REPORTS_DIR: ${{ steps.report-directory.outputs.path }}
# run: ./scripts/integration-tests
# - uses: hoverkraft-tech/ci-github-common/actions/quality/prepare-ci-reports@d22d9532441a353f54431721affbf3ec7874034b # PR #683
# if: ${{ !cancelled() && steps.report-directory.outcome == 'success' }}
# with:
# directory: ${{ steps.report-directory.outputs.path }}
# outcome: ${{ steps.integration.outcome }}
# definition: |
# {
# "name": "Integration tests",
# "project": "application",
# "reports": [{"kind": "test"}]
# }
# - name: Clean integration report directory
# if: ${{ always() && steps.report-directory.outputs.path != '' }}
# env:
# REPORT_DIRECTORY: ${{ steps.report-directory.outputs.path }}
# run: rm -rf -- "$REPORT_DIRECTORY"
# ```
#
# Write supported native outputs under `CI_REPORTS_DIR`. Required missing, malformed
# or empty reports fail the producer. Selected native files and valid converted
# results are retained after failures; unrelated files are not uploaded.
#
# ## Provider action contract
#
# The provider owns command execution and a fresh output directory. After the
# command, including failure, call `actions/quality/prepare-ci-reports` with:
#
# - `directory`: the directory populated by this command.
# - `outcome`: the command's actual step outcome.
# - `definition`: JSON containing `name`, repository-relative `project`, optional
# `variant`, and `reports` selectors.
#
# ```json
# {
# "name": "Python tests",
# "project": "services/api",
# "variant": { "runtime": "3.14" },
# "reports": [{ "kind": "test" }, { "kind": "coverage", "language": "Python" }]
# }
# ```
#
# The language action declares required kinds, not filenames. Preparation discovers
# supported JSON, XML, SARIF and LCOV reports recursively in the command's fresh
# directory. A combined Jest/Vitest report supplies tests and coverage and is
# retained once. Missing required kinds or malformed report files fail preparation;
# other valid evidence remains available. Coverage HTML and other ancillary outputs
# are ignored. The publisher receives the same normalized artifact contract.
#
# A custom producer may use a `pattern` to narrow selection, relative to its fresh
# directory, or a `format` for another Reviewdog-supported format. Those are provider
# implementation details, not language workflow inputs. Paths cannot escape through
# traversal or symlinks. Each selected file must be nonempty and at most 100 MiB.
# Source paths for tests and lint are resolved inside the checkout. A
# `path-mapping` object can map container prefixes to repository-relative paths;
# prebuilt source must match the workflow commit.
#
# | Evidence | Supported inputs | Maintained conversion |
# | -------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------- |
# | Tests | JUnit, CTRF, Jest/Vitest JSON | JUnit-to-CTRF, Jest JUnit reporter and CTRF schema validation |
# | Lint | SARIF, Checkstyle, ESLint JSON, named Reviewdog formats | Reviewdog and Microsoft's ESLint SARIF formatter |
# | Coverage | Cobertura, LCOV, Clover and ReportGenerator-supported coverage XML; Istanbul JSON or Jest/Vitest coverageMap | ReportGenerator and Istanbul |
#
# Astro diagnostics use a Reviewdog errorformat. The native Super-Linter Markdown
# summary is retained directly; Super-Linter continues to own its annotations.
# CodeQL keeps its own code-scanning results.
#
# A Jest/Vitest JSON file containing `coverageMap` can be selected for both
# tests and coverage. Clover supplies coverage, not test outcomes. Go's provider
# uses gocover-cobertura to convert its native profile before normalization.
#
# The uploaded artifact contains a small `report.json` manifest, normalized CTRF
# and Reviewdog JSON, normalized coverage, and selected native evidence. The
# publisher consumes these standard outputs without reparsing native formats.
# Normalized coverage uses repository-relative file identities so files with the
# same basename in different projects remain separate when merged.
name: Prepare CI reports
description: Validate and normalize test, lint and coverage reports for consolidated publication.
author: hoverkraft
branding:
icon: file-text
color: blue
inputs:
directory:
description: Fresh report directory populated by the producer command.
required: true
definition:
description: JSON name, project, variant and required report kinds, with optional coverage language. Supported native files are discovered automatically; a pattern can narrow selection for custom producers.
required: true
outcome:
description: Actual producer command outcome (success, failure or cancelled).
required: true
outputs:
artifact-id:
description: Report artifact ID, discovered automatically by the publication workflow.
value: ${{ steps.upload.outputs.artifact-id }}
runs:
using: composite
steps:
- uses: reviewdog/action-setup@d8a7baabd7f3e8544ee4dbde3ee41d0011c3a93f # v1.5.0
if: contains(inputs.definition, '"lint"')
with:
reviewdog_version: v0.21.3
- id: prepare
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
ACTION_PATH: ${{ github.action_path }}
REPORT_DIRECTORY: ${{ inputs.directory }}
DEFINITION: ${{ inputs.definition }}
OUTCOME: ${{ inputs.outcome }}
with:
script: |
const { PrepareReports } = await import(require('node:url').pathToFileURL(`${process.env.ACTION_PATH}/dist/index.js`));
await new PrepareReports({core, exec, context}).prepare({
directory: process.env.REPORT_DIRECTORY, definition: process.env.DEFINITION,
outcome: process.env.OUTCOME, workspace: process.env.GITHUB_WORKSPACE,
temporaryDirectory: process.env.RUNNER_TEMP,
});
# FIXME: Replace this temporary ReportGenerator/.NET dependency with grcov
# after these changes are released and the report contract is validated:
# https://github.com/mozilla/grcov/pull/1568 (LCOV branch counts)
# https://github.com/mozilla/grcov/pull/1569 (Cobertura and Clover XML inputs).
- uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
if: steps.prepare.outputs.coverage != ''
with:
dotnet-version: "10.0.x"
- name: Normalize coverage with ReportGenerator
id: coverage
if: steps.prepare.outputs.coverage != ''
uses: danielpalme/ReportGenerator-GitHub-Action@70c37c4d588cff5bf9cf190830c6f01dfcfb884b # 5.6.1
with:
reports: ${{ steps.prepare.outputs.coverage }}
targetdir: ${{ steps.prepare.outputs.directory }}/coverage
toolpath: ${{ runner.temp }}/reportgenerator-5.6.1
reporttypes: Cobertura;JsonSummary
sourcedirs: ${{ steps.prepare.outputs.source-directory }};${{ github.workspace }}
- id: finish
if: ${{ !cancelled() && steps.prepare.outputs.directory != '' }}
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
ACTION_PATH: ${{ github.action_path }}
REPORT_DIRECTORY: ${{ steps.prepare.outputs.directory }}
COVERAGE_OUTCOME: ${{ steps.coverage.outcome }}
SOURCE_DIRECTORY: ${{ steps.prepare.outputs.source-directory }}
with:
script: |
const { PrepareReports } = await import(require('node:url').pathToFileURL(`${process.env.ACTION_PATH}/dist/index.js`));
await new PrepareReports({core, exec, context}).finish(process.env.REPORT_DIRECTORY, process.env.COVERAGE_OUTCOME, `${process.env.RUNNER_TEMP}/reportgenerator-5.6.1/reportgenerator`, process.env.SOURCE_DIRECTORY);
- id: upload
if: ${{ !cancelled() && steps.finish.outcome == 'success' }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: ${{ steps.prepare.outputs.artifact-name }}
path: ${{ steps.prepare.outputs.directory }}
if-no-files-found: error
retention-days: 7
- name: Enforce producer result and clean staging
if: ${{ always() && steps.prepare.outputs.directory != '' }}
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
REPORT_DIRECTORY: ${{ steps.prepare.outputs.directory }}
ERRORS: ${{ steps.finish.outputs.errors }}
OUTCOME: ${{ inputs.outcome }}
REPORT_FAILED: ${{ steps.finish.outputs.failed }}
with:
script: |
await io.rmRF(process.env.REPORT_DIRECTORY);
const errors = JSON.parse(process.env.ERRORS || '[]');
if (errors.length) core.setFailed(errors.join('\n'));
if (process.env.OUTCOME !== 'success') core.setFailed(`Producer command ${process.env.OUTCOME}. See its logs and retained reports.`);
if (process.env.REPORT_FAILED === 'true') core.setFailed('The retained report contains failed checks.');
- Vorherrschende Sprache
- JavaScript
- Sterne
- 5
- Forks
- 1
- Ø Merge
- 5 Std. 25 Min.
- Gemergte PRs (30 T.)
- 60
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus hoverkraft-tech/ci-github-common
-
bug need-fix
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 73/100
hoverkraft-tech/ci-github-common#694 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug need-fix
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 76/100
hoverkraft-tech/ci-github-common#691 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug need-fix
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
hoverkraft-tech/ci-github-common#690 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug need-fix
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 83/100
hoverkraft-tech/ci-github-common#688 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug need-fix
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 48/100
hoverkraft-tech/ci-github-common#695 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in hoverkraft-tech/ci-github-common
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 83/100
TheOdinProject/curriculum#31596 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
mailcow/mailcow-dockerized#7725 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 94/100
solana-foundation/solana-com#2579 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 85/100
vercel-labs/agent-skills#385 ·
-
documentation good first issue
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
danielcuesta007/skeptic#73 ·
Maintainer antworten meist innerhalb von 1 Tag