-
Notifications
You must be signed in to change notification settings - Fork 407
Expand file tree
/
Copy pathaction.yml
More file actions
45 lines (43 loc) · 2.21 KB
/
Copy pathaction.yml
File metadata and controls
45 lines (43 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Upload Coverage Artifact
description: Upload a job's LCOV report as a GitHub Actions artifact for All Green to collect and group.
inputs:
flags:
description: Coverage flags — the grouping key All Green folds matrix cells by
required: true
report-dir:
description: Coverage report directory
required: false
default: coverage
runs:
using: composite
steps:
# The reports live at `<report-dir>/node-<version>-<label>/lcov.info`, one level below
# `report-dir`, so the presence check has to recurse — a top-level-only probe finds nothing and
# silently skips the upload, which is what starved the Datadog coverage upload. Only lcov ships:
# both Datadog and Codecov ingest it (see `scripts/upload-coverage.mjs`).
- id: check
shell: bash
run: |
count=$(find "${{ inputs.report-dir }}" -name lcov.info -type f 2>/dev/null | wc -l | tr -d ' ')
echo "has_coverage=$([ "$count" -gt 0 ] && echo true || echo false)" >> "$GITHUB_OUTPUT"
# The artifact name carries the grouping flag plus a per-cell suffix (`__<job>-<matrix-index>`)
# so matrix cells that share a flag — cypress varies `spec` outside its flag — upload distinct
# artifacts instead of clobbering each other under one name.
- if: github.actor != 'dependabot[bot]' && steps.check.outputs.has_coverage == 'true'
id: upload
continue-on-error: true
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: coverage-${{ inputs.flags }}__${{ github.job }}-${{ strategy.job-index }}
path: ${{ inputs.report-dir }}/**/lcov.info
retention-days: 1
- if: github.actor != 'dependabot[bot]' && steps.check.outputs.has_coverage == 'true' && steps.upload.outcome == 'failure'
shell: bash
run: sleep 10
- if: github.actor != 'dependabot[bot]' && steps.check.outputs.has_coverage == 'true' && steps.upload.outcome == 'failure'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: coverage-${{ inputs.flags }}__${{ github.job }}-${{ strategy.job-index }}
path: ${{ inputs.report-dir }}/**/lcov.info
retention-days: 1
overwrite: true