Bump to phpbench 1.6.0 and update github-benchmark report #17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Benchmark | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| benchmark: | |
| name: Benchmark | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| coverage: none | |
| php-version: "8.2" | |
| tools: composer:v2 | |
| - name: Composer install | |
| uses: ramsey/composer-install@v2 | |
| with: | |
| composer-options: "--no-scripts" | |
| - name: Ensure gh-pages branch exists | |
| run: | | |
| if ! git ls-remote --exit-code --heads origin gh-pages > /dev/null 2>&1; then | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| empty_tree="$(git hash-object -t tree /dev/null)" | |
| commit="$(git commit-tree "$empty_tree" -m 'Initial gh-pages branch')" | |
| git push origin "$commit:refs/heads/gh-pages" | |
| fi | |
| - name: Run PHPBench | |
| run: vendor/bin/phpbench run --progress=plain --report=github-action-benchmark --output=json > output.json | |
| - name: Store benchmark result | |
| uses: benchmark-action/github-action-benchmark@v1 | |
| with: | |
| name: Phpactor Benchmarks | |
| tool: customSmallerIsBetter | |
| output-file-path: output.json | |
| gh-pages-branch: gh-pages | |
| benchmark-data-dir-path: dev/bench | |
| auto-push: true | |
| github-token: ${{ secrets.GITHUB_TOKEN }} |