benchmark.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # we're running the benchmarks in a job separate from CI as it may take some time to finish
  2. on:
  3. push:
  4. branches:
  5. - benchmark-runner
  6. name: "Benchmark"
  7. env:
  8. PHP_EXTENSIONS: fileinfo, gd, imagick, json, mbstring
  9. PHP_INI_VALUES: memory_limit=-1, error_reporting=-1, display_errors=On
  10. jobs:
  11. benchmark:
  12. name: "Run Benchmark suite"
  13. runs-on: ubuntu-latest
  14. steps:
  15. - name: "Checkout sources"
  16. uses: actions/checkout@v4
  17. with:
  18. ref: main
  19. - name: "Install PHP"
  20. uses: shivammathur/setup-php@v2
  21. with:
  22. php-version: "8.3"
  23. extensions: opcache, ${{ env.PHP_EXTENSIONS }}
  24. ini-values: ${{ env.PHP_INI_VALUES }}
  25. coverage: none
  26. - name: "Install dependencies with composer"
  27. uses: ramsey/composer-install@v3
  28. with:
  29. working-directory: main
  30. - name: "Run PHPBench"
  31. run: php main/vendor/bin/phpbench run --progress=plain --report=bare --output=csv
  32. - name: "Parse benchmark results"
  33. run: php main/benchmark/parse-result.php
  34. - name: "Generate HTML report"
  35. run: php main/benchmark/generate-html.php
  36. - name: "Generate Markdown report"
  37. run: php main/benchmark/generate-markdown.php
  38. - name: "Publish results to branch benchmark"
  39. uses: JamesIves/github-pages-deploy-action@v4
  40. with:
  41. branch: benchmark
  42. folder: main/.build/phpbench
  43. clean: true