Skip to content

Commit 2a6ccc1

Browse files
sedghiclaude
andcommitted
ci: seed CodSpeed baseline on main pushes and workflow_dispatch
The current detect-changes job short-circuits when HEAD === origin/main: git diff origin/main..HEAD is empty, so any=false and every downstream job (including codspeed-bench) is skipped. That left CodSpeed with no baseline data on main after #64 merged, so every PR comment stays stuck on "Congrats! CodSpeed is installed" with no before/after deltas. Two fixes: - Drop branches-ignore: main so every commit landing on main triggers a build/test/bench run. Future merges will auto-seed the baseline. - In detect-changes, treat workflow_dispatch or any push to refs/heads/main as a "baseline run" and force the full package list, bypassing the diff check that vacuously returns empty when HEAD is main. After this lands, dispatching pr-checks against main (or just pushing this fix to main) will populate the CodSpeed baseline, and PR #66's codspeed-bench will start producing a real regression report on re-run. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 728def4 commit 2a6ccc1

1 file changed

Lines changed: 23 additions & 3 deletions

File tree

.github/workflows/pr-checks.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ name: PR checks
1111
on:
1212
pull_request:
1313
push:
14-
branches-ignore:
15-
- main
14+
# Run on every branch including main so each merge to main seeds a
15+
# fresh CodSpeed baseline. Without a main run, PR comments stay stuck
16+
# on "Congrats! CodSpeed is installed" with no before/after deltas.
17+
branches:
18+
- "**"
1619
# workflow_dispatch lets CodSpeed trigger a backtest run from the
1720
# dashboard (to seed initial perf data after the repo is connected).
1821
workflow_dispatch:
@@ -43,11 +46,28 @@ jobs:
4346
fetch-depth: 0
4447
- id: list
4548
name: List changed packages
49+
env:
50+
EVENT_NAME: ${{ github.event_name }}
51+
REF: ${{ github.ref }}
4652
run: |
4753
set -e
54+
ALL=(charls libjpeg-turbo-8bit libjpeg-turbo-12bit openjpeg openjphjs little-endian big-endian dicom-codec)
55+
56+
# Baseline runs: on a manual dispatch or any commit landing on
57+
# main, build/test/bench every package. The "diff vs main" trick
58+
# only makes sense on PR/feature branches — when HEAD === main,
59+
# `git diff origin/main..HEAD` is empty and would skip CodSpeed
60+
# entirely, leaving the dashboard with no baseline data.
61+
if [ "$EVENT_NAME" = "workflow_dispatch" ] || [ "$REF" = "refs/heads/main" ]; then
62+
json=$(printf '%s\n' "${ALL[@]}" | jq -R . | jq -s -c .)
63+
echo "Baseline run ($EVENT_NAME on $REF): forcing all packages"
64+
echo "packages=$json" >> "$GITHUB_OUTPUT"
65+
echo "any=true" >> "$GITHUB_OUTPUT"
66+
exit 0
67+
fi
68+
4869
git fetch --no-tags --depth=50 origin main || true
4970
BASE=$(git merge-base origin/main HEAD || echo "origin/main")
50-
ALL=(charls libjpeg-turbo-8bit libjpeg-turbo-12bit openjpeg openjphjs little-endian big-endian dicom-codec)
5171
changed=()
5272
for pkg in "${ALL[@]}"; do
5373
if ! git diff --quiet "$BASE"..HEAD -- "packages/$pkg/"; then

0 commit comments

Comments
 (0)