diff --git a/.github/workflows/reprocess.yml b/.github/workflows/reprocess.yml new file mode 100644 index 0000000000..90ab0de278 --- /dev/null +++ b/.github/workflows/reprocess.yml @@ -0,0 +1,66 @@ +name: Reprocess Benchmark Results + +# Re-runs process + deploy from an EXISTING benchmark run's artifacts, writing +# the results to an explicit date folder. Use case: a run whose process step +# crossed UTC midnight and stamped the wrong date. The date input must match +# the calendar day the run's benchmark jobs actually executed. +# +# Artifacts are retained for 7 days, so this only works on recent runs. +on: + workflow_dispatch: + inputs: + run-id: + description: "The benchmark workflow run ID whose artifacts to reprocess" + required: true + date: + description: "Date folder to write (YYYY-MM-DD; the day the benchmarks ran)" + required: true + +jobs: + reprocess: + name: "Reprocess & Deploy" + runs-on: ubuntu-24.04-arm + timeout-minutes: 15 + permissions: + contents: write + steps: + - uses: actions/checkout@v6 + - name: Install Node + uses: actions/setup-node@v6 + with: + node-version: "24" + - name: Download Results + uses: actions/download-artifact@v8 + with: + path: results + pattern: results-* + run-id: ${{ inputs.run-id }} + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Download Versions + uses: actions/download-artifact@v8 + with: + path: versions-temp + pattern: versions-* + run-id: ${{ inputs.run-id }} + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Process Results + env: + BENCH_DATE: ${{ inputs.date }} + run: | + ./bench process + - name: Install vlt + run: | + npm install -g vlt@latest + - name: Build Charts View + run: | + pushd app + vlt install + vlt run build + popd + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: results + keep_files: true + full_commit_message: "reprocess: run ${{ inputs.run-id }} -> ${{ inputs.date }} (dispatched via ${{ github.workflow }} run ${{ github.run_id }})" diff --git a/scripts/process-results.sh b/scripts/process-results.sh index 65a5239211..42d7662483 100644 --- a/scripts/process-results.sh +++ b/scripts/process-results.sh @@ -2,7 +2,8 @@ set -Eeuxo pipefail # Get current date for results directory -DATE=$(date +%Y-%m-%d) +# BENCH_DATE overrides the folder date (see .github/workflows/reprocess.yml) +DATE=${BENCH_DATE:-$(date +%Y-%m-%d)} # Create results directory structure mkdir -p "results/$DATE"