Skip to content

Benchmark github action #9

Benchmark github action

Benchmark github action #9

Workflow file for this run

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 }}
- name: Update baseline
run: swift package --allow-writing-to-package-directory benchmark baseline update main --no-progress
- name: Debug baseline
run: |
echo "PWD:"
pwd
echo "Directories:"
find . -type d -name "*benchmark*" -o -name ".benchmarkBaselines"
echo "Files:"
find . -type f -name "results.json"
- name: Upload baseline
uses: actions/upload-artifact@v7
with:
name: benchmark-baseline
path: .benchmarkBaselines
include-hidden-files: true
- name: Checkout current
uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.head.sha }}
- 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