Skip to content
This repository has been archived by the owner on Mar 6, 2022. It is now read-only.

Commit

Permalink
Add PHPBench Regression Test (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
dantleech authored Jan 10, 2021
1 parent 8783b78 commit d90b3a2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
21 changes: 21 additions & 0 deletions .github/phpbench_regression_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -e

RETRY_THRESHOLD=${RETRY_THRESHOLD:-5}

echo -e "\n\n"
echo -e "Benchmarking master branch"
echo -e "==========================\n\n"
git fetch origin master &> /dev/null
git checkout master &> /dev/null
mv composer.lock composer.lock.pr
composer install --quiet
vendor/bin/phpbench run --report=aggregate --progress=travis --retry-threshold=$RETRY_THRESHOLD --tag=master

echo -e "\n\n"
echo -e "Benchmarking GITHUB_REF and comparing to master"
echo -e "==================================================\n\n"
git checkout - &> /dev/null
mv composer.lock.pr composer.lock
composer install --quiet
vendor/bin/phpbench run --report=aggregate --progress=travis --retry-threshold=$RETRY_THRESHOLD --ref=master
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
name: "Run PHPUnit"
run: "vendor/bin/phpunit"
phpbench:
name: "PHPBench (smoke test)"
name: "PHPBench Regression Test"

runs-on: "ubuntu-latest"

Expand Down Expand Up @@ -146,5 +146,5 @@ jobs:
with:
composer-options: "--no-scripts"
-
name: "Run PHPBench"
run: "vendor/bin/phpbench run --progress=travis --iterations=1 --revs=1"
name: "PHPBench Regression Test"
run: ".github/phpbench_regression_test.sh"
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"friendsofphp/php-cs-fixer": "^2.17",
"phpactor/completion-worse-extension": "^0.1.2",
"phpactor/test-utils": "^1.1",
"phpbench/phpbench": "^1.0.0-alpha3",
"phpbench/phpbench": "^1.0.0-alpha5",
"phpspec/prophecy-phpunit": "dev-master",
"phpstan/phpstan": "~0.12.0",
"phpunit/phpunit": "~9.0",
Expand Down

0 comments on commit d90b3a2

Please sign in to comment.