Skip to content

chore(skills): derive integration inspector evidence #28185

chore(skills): derive integration inspector evidence

chore(skills): derive integration inspector evidence #28185

Workflow file for this run

name: All Green
on:
pull_request:
push:
branches:
- master
schedule:
- cron: 0 4 * * *
concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_id || github.ref }}
cancel-in-progress: true
jobs:
all-green:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: DataDog/dd-octo-sts-action@96a25462dbcb10ebf0bfd6e2ccc917d2ab235b9a # v1.0.4
id: octo-sts
with:
scope: DataDog/dd-trace-js
policy: all-green
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
sparse-checkout-cone-mode: false
sparse-checkout: |
.github
scripts
- uses: ./.github/actions/node
with:
version: active
- run: yarn add @actions/core @actions/github octokit
- run: node scripts/all-green.mjs
env:
DELAY: ${{ github.run_attempt == 1 && '1' || '0' }} # 1 minute on first attempt, no delay on reruns
RUN_ATTEMPT: ${{ github.run_attempt }}
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ steps.octo-sts.outputs.token }}
POLLING_INTERVAL: 1
RETRIES: 20
# Sort every downloaded per-cell `coverage-*` artifact into one directory per integration under
# `coverage-upload/<group>/{lcov,json}/`. The reports are not merged here — both backends merge
# same-flag uploads server-side — so each cell's report passes through byte-for-byte. Codecov
# gets the istanbul JSON (carries branch/function coverage), Datadog gets the lcov.
- if: "!cancelled()"
run: node scripts/group-coverage.mjs
- if: "!cancelled()"
uses: ./.github/actions/dd-sts-api-key
id: dd-sts
- if: "!cancelled()"
uses: ./.github/actions/datadog-ci
- if: "!cancelled()"
run: datadog-ci junit upload --service dd-trace-js-tests --auto-discovery junit-results
env:
DD_API_KEY: ${{ steps.dd-sts.outputs.api_key }}
# One Datadog upload per integration, flagged with the integration name so coverage is
# attributable in the Datadog UI the same way the Codecov flags attribute it. Datadog reads the
# lcov reports; it does not ingest istanbul's JSON.
- if: "!cancelled()"
run: |
set -o pipefail
shopt -s nullglob
# shellcheck disable=SC2016 # the inner shell must expand "$1", not the template.
printf '%s\0' coverage-upload/*/lcov/ | xargs -0 -r -P 20 -I {} \
bash -c 'datadog-ci coverage upload "$1" --flags "$(basename "$(dirname "$1")")"' _ {}
env:
DD_API_KEY: ${{ steps.dd-sts.outputs.api_key }}
# One Codecov upload per integration via the CLI directly — the codecov-action would re-validate
# and re-download the uploader once per group (~100×). Codecov reads branch/function coverage
# from the istanbul JSON, so the upload points at each group's `json/` subdirectory.
# `master-coverage` is the flag `.codecov.yml` gates `codecov/patch` on; attach it only on PRs
# targeting master so release-branch PRs auto-pass. The SHA/branch/PR are passed explicitly
# because All Green checks out the merge ref, not the head the other workflows reported coverage
# for. No token: the repo uploads tokenless (a Codecov token would have to be an org secret,
# which forks can't read).
- if: "!cancelled()"
run: |
commit_args=(--sha "$HEAD_SHA" --branch "$HEAD_BRANCH")
upload_args=(--sha "$HEAD_SHA")
if [ -n "$PR_NUMBER" ]; then
commit_args+=(--pr "$PR_NUMBER")
upload_args+=(--pr "$PR_NUMBER")
fi
master_flag=()
if [ "$GITHUB_EVENT_NAME" = "pull_request" ] && [ "$BASE_REF" = "master" ]; then
master_flag=(-F master-coverage)
fi
shopt -s nullglob
groups=(coverage-upload/*/json/)
[ ${#groups[@]} -gt 0 ] || exit 0
pip install --quiet codecov-cli
# create-commit and create-report set up the report once and must finish before any upload;
# only the do-upload fan-out is safe to parallelize.
codecovcli create-commit "${commit_args[@]}"
codecovcli create-report --sha "$HEAD_SHA"
set -o pipefail
# shellcheck disable=SC2016 # the inner shell must expand "$@"/"$dir", not the template.
printf '%s\0' "${groups[@]}" | xargs -0 -r -P 20 -I {} \
bash -c 'dir="$1"; shift; codecovcli do-upload "$@" --dir "$dir" -F "$(basename "$(dirname "$dir")")"' \
_ {} "${upload_args[@]}" "${master_flag[@]}"
env:
GITHUB_EVENT_NAME: ${{ github.event_name }}
BASE_REF: ${{ github.base_ref }}
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
HEAD_BRANCH: ${{ github.head_ref || github.ref_name }}
PR_NUMBER: ${{ github.event.pull_request.number }}