Skip to content

Commit

Permalink
ci: check performance regressions with CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kkebo committed Oct 11, 2024
1 parent 3f268f0 commit 637c48f
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,40 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: swift format lint -rs .
benchmark:
if: ${{ github.ref != 'refs/heads/main' }}
needs: test
runs-on: ubuntu-latest
container: swiftlang/swift:nightly-6.0-jammy
steps:
- uses: actions/checkout@v4
- run: apt-get update && apt-get install --no-install-recommends -y libjemalloc-dev
- run: swift package --package-path Benchmarks benchmark baseline update pull_request --no-progress --quiet
- name: Switch to branch 'main'
uses: actions/checkout@v4
with:
ref: main
clean: false
- run: swift package --package-path Benchmarks benchmark baseline update main --no-progress --quiet
- name: swift package benchmark baseline check
continue-on-error: true
run: |
echo '## Summary' >> "$GITHUB_STEP_SUMMARY"
echo "$(date)" >> "$GITHUB_STEP_SUMMARY"
swift package --package-path Benchmarks benchmark baseline check main pull_request --format markdown >> "$GITHUB_STEP_SUMMARY"
- name: swift package benchmark baseline compare
run: |
echo >> "$GITHUB_STEP_SUMMARY"
echo '---' >> "$GITHUB_STEP_SUMMARY"
swift package --package-path Benchmarks benchmark baseline compare main pull_request --no-progress --quiet --format markdown >> "$GITHUB_STEP_SUMMARY"
- name: Pull request comment text
id: prtest
run: |
echo 'PRTEST<<EOF' >> "$GITHUB_OUTPUT"
echo "[Pull request benchmark comparison with 'main' run at $(date -Iseconds)](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> "$GITHUB_OUTPUT"
echo 'EOF' >> "$GITHUB_OUTPUT"
- name: Comment PR
uses: thollander/actions-comment-pull-request@v3
with:
message: ${{ steps.prtest.outputs.PRTEST }}
comment-tag: benchmark

0 comments on commit 637c48f

Please sign in to comment.