Replace this temporary ReportGenerator/.NET dependency with grcov
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Refactoring
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- github-actions, javascript
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.');
- Lingua principale
- JavaScript
- Stelle
- 5
- Fork
- 1
- Merge medio
- 5h 25m
- PR unite (30g)
- 60
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di hoverkraft-tech/ci-github-common
-
bug need-fix
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
hoverkraft-tech/ci-github-common#694 ·
I maintainer di solito rispondono entro 1 giorno
-
bug need-fix
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 76/100
hoverkraft-tech/ci-github-common#691 ·
I maintainer di solito rispondono entro 1 giorno
-
bug need-fix
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
hoverkraft-tech/ci-github-common#690 ·
I maintainer di solito rispondono entro 1 giorno
-
bug need-fix
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 83/100
hoverkraft-tech/ci-github-common#688 ·
I maintainer di solito rispondono entro 1 giorno
-
bug need-fix
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
hoverkraft-tech/ci-github-common#695 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di hoverkraft-tech/ci-github-common
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 83/100
TheOdinProject/curriculum#31596 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
mailcow/mailcow-dockerized#7725 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 94/100
solana-foundation/solana-com#2579 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
vercel-labs/agent-skills#385 ·
-
documentation good first issue
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
danielcuesta007/skeptic#73 ·
I maintainer di solito rispondono entro 1 giorno