Update benchmarks #30
Workflow file for this run
This file contains 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: Benchmark PR vs main | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: [ main ] | |
jobs: | |
benchmark-delta-linux: | |
runs-on: ubuntu-latest | |
container: swift:jammy | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: jemalloc dependency | |
run: apt-get update && apt-get install -y libjemalloc-dev | |
- name: Fix Git config | |
run: | | |
git config --global --add safe.directory "${GITHUB_WORKSPACE}" | |
- name: Run benchmarks for PR branch | |
continue-on-error: true | |
run: | | |
swift package -c release --package-path Benchmarks --disable-sandbox benchmark baseline update pull_request | |
- name: Run benchmarks for 'main' branch | |
run: | | |
git stash | |
git checkout main | |
swift package -c release --package-path Benchmarks --disable-sandbox benchmark baseline update main | |
- name: Compare benchmarks | |
continue-on-error: true | |
run: | | |
date >> "${GITHUB_STEP_SUMMARY}" | |
swift package -c release --package-path Benchmarks benchmark baseline check main pull_request --format markdown >> "${GITHUB_STEP_SUMMARY}" | |
- name: Get formatted date | |
id: get-date | |
run: echo "date=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_OUTPUT | |
- uses: thollander/actions-comment-pull-request@v2 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
message: ${{ format('[PR benchmark comparison with main on ubuntu-latest run at {0}]({1}/{2}/actions/runs/{3})', steps.get-date.outputs.date, github.server_url, github.repository, github.run_id) }} | |
comment_tag: 'PR benchmark comparison Linux' |