Skip to content

Commit

Permalink
Merge pull request #29578 from storybookjs/jeppe/fix-bench-ci
Browse files Browse the repository at this point in the history
CI: Fix package benchmarking failing on `next`
  • Loading branch information
JReinhold authored Nov 11, 2024
2 parents b651578 + 844e48e commit 3b22843
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 11 deletions.
46 changes: 36 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,16 +220,42 @@ jobs:
clone_options: "--depth 1 --verbose"
- attach_workspace:
at: .
- run:
name: Benchmarking Packages
working_directory: scripts
command: |
yarn local-registry --open &
until curl -s http://localhost:6001 > /dev/null; do
echo 'Waiting for local registry to be available...'
sleep 2
done
yarn bench-packages --baseBranch << pipeline.parameters.ghBaseBranch >> --pull-request << pipeline.parameters.ghPrNumber >> --upload
# if there is a base branch AND a PR number in parameters, benchmark packages against those
# this happens when run against a PR
- when:
condition:
and:
- << pipeline.parameters.ghBaseBranch >>
- << pipeline.parameters.ghPrNumber >>
steps:
- run:
name: Benchmarking packages against base branch
working_directory: scripts
command: |
yarn local-registry --open &
until curl -s http://localhost:6001 > /dev/null; do
echo 'Waiting for local registry to be available...'
sleep 2
done
yarn bench-packages --base-branch << pipeline.parameters.ghBaseBranch >> --pull-request << pipeline.parameters.ghPrNumber >> --upload
# if there is a NOT a base branch OR NOT a PR number in parameters, just upload benchmarks for the branch
# this happens when runned directly on branches, like next or main
- when:
condition:
or:
- not: << pipeline.parameters.ghBaseBranch >>
- not: << pipeline.parameters.ghPrNumber >>
steps:
- run:
name: Uploading package benchmarks for branch
working_directory: scripts
command: |
yarn local-registry --open &
until curl -s http://localhost:6001 > /dev/null; do
echo 'Waiting for local registry to be available...'
sleep 2
done
yarn bench-packages --upload
- store_artifacts:
path: bench/packages/results.json
- store_artifacts:
Expand Down
2 changes: 1 addition & 1 deletion scripts/bench/bench-packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ const uploadToGithub = async ({
const run = async () => {
program
.option(
'-b, --baseBranch <string>',
'-b, --base-branch <string>',
'The base branch to compare the results with. Requires GCP_CREDENTIALS env var'
)
.option(
Expand Down

0 comments on commit 3b22843

Please sign in to comment.