Skip to content

Fix package manifests #149

Fix package manifests

Fix package manifests #149

name: Benchmark baseline
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
benchmark:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-12]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install jemalloc Linux
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y libjemalloc-dev
- name: Install jemalloc macOS
if: matrix.os == 'macos-12'
run: brew install jemalloc
- run: echo "/opt/homebrew/bin:/usr/local/bin" >> $GITHUB_PATH
- name: Run benchmarks
id: benchmark
run: |
echo $(date) >> $GITHUB_STEP_SUMMARY
swift package benchmark --format markdown --no-progress >> $GITHUB_STEP_SUMMARY
- name: Pull request comment text
id: prtest
run: |
echo 'PRTEST<<EOF' >> $GITHUB_ENV
echo "[Pull request benchmark baseline [${{ matrix.os }}] run at $(date -Iseconds)](https://github.com/ordo-one/${{ github.event.repository.name }}/actions/runs/${{ github.run_id }})" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Comment PR
uses: thollander/actions-comment-pull-request@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
message: ${{ env.PRTEST }}
comment_includes: "Pull request benchmark baseline [${{ matrix.os }}] run"