Process Benchmark #5
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: Process Benchmark | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| benchmark_data: | |
| description: 'Base64 encoded benchmark data' | |
| required: true | |
| benchmark_name: | |
| description: 'Name for benchmark group on the dashboard' | |
| required: false | |
| default: 'RAJAPerf benchmarks' | |
| jobs: | |
| check-performance: | |
| if: github.ref != 'refs/heads/develop' | |
| permissions: | |
| # Needed to write PR check status | |
| checks: write | |
| # Need write if you turn on comments | |
| pull-requests: read | |
| contents: read | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Find associated PR | |
| id: findpr | |
| run: | | |
| echo "Looking for PR with head branch: ${{ github.ref_name }}" | |
| gh pr list --head ${{ github.ref_name }} --json number,title | |
| PR_NUMBER=$(gh pr list --head ${{ github.ref_name }} --json number -q '.[0].number') | |
| echo "Found PR number: $PR_NUMBER" | |
| echo "pr_number=$PR_NUMBER" >> $GITHUB_OUTPUT | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Decode benchmark data | |
| run: echo "${{ github.event.inputs.benchmark_data }}" | base64 -d > benchmark.json | |
| - name: Compare benchmark result | |
| id: benchmark | |
| continue-on-error: true | |
| uses: benchmark-action/github-action-benchmark@v1 | |
| with: | |
| name: ${{ github.event.inputs.benchmark_name }} | |
| tool: 'customSmallerIsBetter' | |
| output-file-path: benchmark.json | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| auto-push: false | |
| save-data-file: false | |
| gh-pages-branch: gh-pages | |
| benchmark-data-dir-path: dev/bench | |
| comment-always: false | |
| comment-on-alert: false | |
| summary-always: true | |
| fail-on-alert: true | |
| alert-threshold: '120%' | |
| max-items-in-chart: 100 | |
| - name: Create Check for PRs | |
| if: steps.findpr.outputs.pr_number != '' | |
| uses: LouisBrunner/checks-action@6b626ffbad7cc56fd58627f774b9067e6118af23 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| name: Performance Benchmark (${{ github.event.inputs.benchmark_name }}) | |
| sha: ${{ github.sha }} | |
| conclusion: ${{ steps.benchmark.outcome == 'success' && 'success' || 'failure' }} | |
| output: | | |
| { | |
| "title": "Performance Results", | |
| "summary": "${{ steps.benchmark.outcome == 'success' && 'Performance check passed' || 'Performance regression detected!' }}", | |
| "text_description": "See job summary for detailed benchmark results: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| } | |
| - name: Final status | |
| if: steps.benchmark.outcome != 'success' | |
| run: exit 1 | |
| store-and-visualize-on-develop: | |
| # if: github.ref == 'refs/heads/develop' # TODO uncomment before merging | |
| permissions: | |
| # Needed to push to gh-pages branch | |
| contents: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Decode benchmark data | |
| run: echo "${{ github.event.inputs.benchmark_data }}" | base64 -d > benchmark.json | |
| - name: Store benchmark result | |
| id: benchmark | |
| uses: benchmark-action/github-action-benchmark@v1 | |
| with: | |
| name: ${{ github.event.inputs.benchmark_name }} | |
| tool: 'customSmallerIsBetter' | |
| output-file-path: benchmark.json | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| auto-push: true | |
| gh-pages-branch: gh-pages | |
| benchmark-data-dir-path: dev/bench | |
| comment-always: false | |
| comment-on-alert: false | |
| summary-always: true | |
| fail-on-alert: true | |
| alert-threshold: '120%' | |
| max-items-in-chart: 100 |