Repository navigation
66 lines (61 loc) · 2.73 KB
/
Copy pathsdk-benchmark-report.yml
File metadata and controls
66 lines (61 loc) · 2.73 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: SDK benchmark report
on:
workflow_call:
inputs:
workflow-path:
description: 'Expected producer workflow path in the calling repository.'
required: true
type: string
artifact-name:
description: 'Exact producer artifact name containing paired results or a shard bundle, plus revisions.json.'
required: true
type: string
report-key:
description: 'Stable comment namespace, unique per SDK within the calling repository.'
required: true
type: string
sdk:
description: 'Expected SDK identifier in every result document.'
required: true
type: string
permissions: {}
jobs:
report:
# A default-branch workflow_run caller is the trust boundary, including for fork PRs.
if: github.event_name == 'workflow_run' && github.event.action == 'completed'
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
contents: read
actions: read
pull-requests: write
# Serialize publishers even when workflow_run has no PR association (common for forks).
# The publisher rechecks head/attempt and source-run ordering immediately before writing.
concurrency:
group: sdk-benchmark-report-${{ github.repository }}-${{ inputs.report-key }}
cancel-in-progress: false
queue: max
steps:
- name: Audit runner egress
uses: step-security/harden-runner@ccd8616d44fd3846e67624a50d5aad6d37bf2d25 # v2.22.1
with:
egress-policy: audit
- name: Verify source run and publish report
uses: PostHog/.github/.github/actions/benchmark-report@04f8421ec4daa7f4066eaeb4c53621ba79ddc3ca # SDK benchmark reporting (PostHog/.github PR #84)
env:
GH_TOKEN: ${{ github.token }}
with:
mode: publish
workflow-path: ${{ inputs.workflow-path }}
artifact-name: ${{ inputs.artifact-name }}
report-key: ${{ inputs.report-key }}
sdk: ${{ inputs.sdk }}
output-directory: ${{ runner.temp }}/sdk-benchmark-report
- name: Preserve rendered report
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: sdk-benchmark-report-${{ inputs.report-key }}
path: ${{ runner.temp }}/sdk-benchmark-report
if-no-files-found: ignore
retention-days: 14