From ecb901ca3972345c6a15758ed9b17ae350aeebf9 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 3 May 2026 13:43:21 +0100 Subject: [PATCH] ci: record tested ref in performance reports --- .github/workflows/openclaw-performance.yml | 53 ++++++++++++++++++++-- docs/ci.md | 5 +- 2 files changed, 52 insertions(+), 6 deletions(-) diff --git a/.github/workflows/openclaw-performance.yml b/.github/workflows/openclaw-performance.yml index 45d32a5d272..a83082b989d 100644 --- a/.github/workflows/openclaw-performance.yml +++ b/.github/workflows/openclaw-performance.yml @@ -5,6 +5,11 @@ on: - cron: "11 5 * * *" workflow_dispatch: inputs: + target_ref: + description: OpenClaw ref to benchmark; defaults to the workflow ref + required: false + default: "" + type: string profile: description: Kova profile to run required: false @@ -92,6 +97,7 @@ jobs: SUMMARY_DIR: ${{ github.workspace }}/.artifacts/kova/summaries SOURCE_PERF_DIR: ${{ github.workspace }}/.artifacts/openclaw-performance/source/${{ matrix.lane }} LANE_ID: ${{ matrix.lane }} + TARGET_REF: ${{ inputs.target_ref || github.ref_name }} PROFILE: ${{ inputs.profile || 'diagnostic' }} REQUESTED_REPEAT: ${{ inputs.repeat || '3' }} FAIL_ON_REGRESSION: ${{ inputs.fail_on_regression || 'false' }} @@ -139,9 +145,25 @@ jobs: if: steps.lane.outputs.run == 'true' uses: actions/checkout@v6 with: + ref: ${{ inputs.target_ref || github.ref }} fetch-depth: 1 persist-credentials: false + - name: Record tested revision + if: steps.lane.outputs.run == 'true' + shell: bash + run: | + set -euo pipefail + tested_sha="$(git rev-parse HEAD)" + echo "TESTED_REF=${TARGET_REF}" >> "$GITHUB_ENV" + echo "TESTED_SHA=${tested_sha}" >> "$GITHUB_ENV" + { + echo "Tested ref: ${TARGET_REF}" + echo "Tested SHA: ${tested_sha}" + echo "Workflow ref: ${GITHUB_REF_NAME}" + echo "Workflow SHA: ${GITHUB_SHA}" + } >> "$GITHUB_STEP_SUMMARY" + - name: Set up Node environment if: steps.lane.outputs.run == 'true' uses: ./.github/actions/setup-node-env @@ -281,7 +303,7 @@ jobs: kova report bundle "$report_json" --output-dir "$BUNDLE_DIR" --json | tee "$BUNDLE_DIR/bundle.json" - ref_slug="$(printf '%s' "${GITHUB_REF_NAME}" | tr -c 'A-Za-z0-9._-' '-')" + ref_slug="$(printf '%s' "${TESTED_REF}" | tr -c 'A-Za-z0-9._-' '-')" run_slug="${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" report_url="" if [[ "${CLAWGRIT_REPORTS_TOKEN_PRESENT:-false}" == "true" ]]; then @@ -293,6 +315,23 @@ jobs: summary_args+=(--report-url "$report_url") fi "${summary_args[@]}" + cat >> "$summary_path" <> "$GITHUB_STEP_SUMMARY" if [[ "$FAIL_ON_REGRESSION" == "true" && "$status" != "0" ]]; then @@ -438,7 +477,7 @@ jobs: run: | set -euo pipefail reports_root=".artifacts/clawgrit-reports" - ref_slug="$(printf '%s' "${GITHUB_REF_NAME}" | tr -c 'A-Za-z0-9._-' '-')" + ref_slug="$(printf '%s' "${TESTED_REF}" | tr -c 'A-Za-z0-9._-' '-')" run_slug="${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" dest="${reports_root}/openclaw-performance/${ref_slug}/${run_slug}/${LANE_ID}" mkdir -p "$dest" @@ -466,8 +505,12 @@ jobs: cat > "${reports_root}/openclaw-performance/${ref_slug}/latest-${LANE_ID}.json" </-//`. The current branch pointer is written as `openclaw-performance//latest-.json`. +Every lane uploads GitHub artifacts. When `CLAWGRIT_REPORTS_TOKEN` is configured, the workflow also commits `report.json`, `report.md`, bundles, `index.md`, and source-probe artifacts into `openclaw/clawgrit-reports` under `openclaw-performance//-//`. The current tested-ref pointer is written as `openclaw-performance//latest-.json`. ## Full Release Validation