Benchmarks: Upload for PR #1057
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: "Benchmarks: Upload for PR" | |
| on: | |
| workflow_run: | |
| workflows: ["Benchmarks: Run for PR"] | |
| types: [completed] | |
| jobs: | |
| upload_benchmark_results: | |
| name: Upload Benchmarks | |
| if: github.event.workflow_run.conclusion == 'success' | |
| permissions: | |
| pull-requests: write | |
| checks: write | |
| runs-on: ubuntu-latest | |
| env: | |
| BENCHMARK_RESULTS: results.json | |
| PR_EVENT: event.json | |
| steps: | |
| - name: Download Benchmark Results | |
| uses: dawidd6/action-download-artifact@v6 | |
| with: | |
| name: ${{ env.BENCHMARK_RESULTS }} | |
| run_id: ${{ github.event.workflow_run.id }} | |
| - name: Download PR Event | |
| uses: dawidd6/action-download-artifact@v6 | |
| with: | |
| name: ${{ env.PR_EVENT }} | |
| run_id: ${{ github.event.workflow_run.id }} | |
| - name: Export PR Event Data | |
| uses: actions/github-script@v6 | |
| with: | |
| script: | | |
| let fs = require('fs'); | |
| let prEvent = JSON.parse(fs.readFileSync(process.env.PR_EVENT, {encoding: 'utf8'})); | |
| core.exportVariable("PR_HEAD", prEvent.pull_request.head.ref); | |
| core.exportVariable("PR_HEAD_SHA", prEvent.pull_request.head.sha); | |
| core.exportVariable("PR_BASE", prEvent.pull_request.base.ref); | |
| core.exportVariable("PR_BASE_SHA", prEvent.pull_request.base.sha); | |
| core.exportVariable("PR_NUMBER", prEvent.number); | |
| - uses: bencherdev/bencher@main | |
| - name: Track Benchmarks with Bencher | |
| run: | | |
| bencher run \ | |
| --project fandango-394f926-x0wdsa1zilqt3 \ | |
| --token '${{ secrets.BENCHER_API_TOKEN }}' \ | |
| --branch "$PR_HEAD" \ | |
| --hash "$PR_HEAD_SHA" \ | |
| --start-point "$PR_BASE" \ | |
| --start-point-hash "$PR_BASE_SHA" \ | |
| --start-point-clone-thresholds \ | |
| --start-point-reset \ | |
| --testbed ubuntu-latest \ | |
| --err \ | |
| --adapter python_pytest \ | |
| --file "$BENCHMARK_RESULTS" \ | |
| --github-actions '${{ secrets.GITHUB_TOKEN }}' \ | |
| --ci-number "$PR_NUMBER" \ |