Benchmark github action #1
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: Run benchmark | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| benchmark: | |
| permissions: | |
| contents: read | |
| runs-on: macos-26 | |
| steps: | |
| - name: Checkout main | |
| uses: actions/checkout@v7 | |
| with: | |
| ref: ${{ github.event.pull_request.base.sha }} | |
| path: base | |
| - name: Update baseline | |
| run: swift package --allow-writing-to-package-directory benchmark baseline update main | |
| - name: Upload baseline | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: benchmark-baseline | |
| path: base/.benchmarkBaselines | |
| - name: Checkout current | |
| uses: actions/checkout@v7 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| path: current | |
| - name: Download baseline | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: benchmark-baseline | |
| path: .benchmarkBaselines | |
| - name: Compare results | |
| run: swift package benchmark baseline compare main \ | |
| --filter ".*inlinestring16.*" \ | |
| --format markdown \ | |
| --no-progress |