Skip to content

Support Swift 6 language mode and Swift Syntax 600.0.0 #14

Support Swift 6 language mode and Swift Syntax 600.0.0

Support Swift 6 language mode and Swift Syntax 600.0.0 #14

Workflow file for this run

name: "Benchmarks"
on:
pull_request:
branches:
- main
jobs:
benchmark:
name: Benchmark
runs-on: macos-14
continue-on-error: true
permissions:
issues: write
pull-requests: write
env:
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
BENCHMARK_PACKAGE: true
BENCHMARK_DISABLE_JEMALLOC: true
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Benchmarks
run: swift package plugin benchmark list
- name: Benchmark Pull Request
run: swift package --allow-writing-to-directory .benchmarkBaselines/ benchmark baseline update pull_request
- name: Switch Branches
run: |
git stash
git checkout main
git stash pop
- name: Benchmark Main
run: swift package --allow-writing-to-directory .benchmarkBaselines/ benchmark baseline update main
- name: Compare Benchmarks
run: |
set +e
benchmarkDate="$(date)"
benchmarkCheckOutput="$(swift package benchmark baseline check main pull_request --format markdown)"
benchmarkExitStatus="$?"
benchmarkCompareOutput="$(swift package benchmark baseline compare main pull_request --no-progress --quiet --format markdown)"
echo "benchmarkDate=$benchmarkDate" >> $GITHUB_ENV
{ echo "benchmarkCheckOutput<<EOF"; echo "$benchmarkCheckOutput"; echo EOF; } >> "$GITHUB_ENV"
echo "benchmarkExitStatus=$benchmarkExitStatus" >> $GITHUB_ENV
{ echo "benchmarkCompareOutput<<EOF"; echo "$benchmarkCompareOutput"; echo EOF; } >> "$GITHUB_ENV"
if [[ $exitStatus -eq 0 ]]; then
echo "benchmarkStatusMessage=✅ Pull Request passed benchmark checks" >> $GITHUB_ENV
else
echo "benchmarkStatusMessage=⚠️ Pull Request may have performance regressions" >> $GITHUB_ENV
fi
- name: Comment
uses: thollander/actions-comment-pull-request@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
comment_tag: benchmark
message: |
${{ env.benchmarkStatusMessage }}
## Summary
${{ env.benchmarkDate }}
${{ env.benchmarkCheckOutput }}
---
${{ env.benchmarkCompareOutput }}
- name: Exit with correct status
run: |
exit ${{ env.benchmarkCompareOutput }}