forked from swift-otel/swift-otel
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (42 loc) · 1.36 KB
/
benchmark.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Benchmark PR vs. main
on:
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-benchmark
cancel-in-progress: true
jobs:
benchmark:
name: Check benchmark regressions
runs-on: ubuntu-latest
timeout-minutes: 15
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
- name: Install jemalloc
run: sudo apt-get install -y libjemalloc-dev
- name: Benchmark PR
run: |
cd Benchmarks
swift package --allow-writing-to-directory .benchmarkBaselines/ benchmark baseline update pr
- name: Benchmark main
run: |
git switch main
cd Benchmarks
swift package --allow-writing-to-directory .benchmarkBaselines/ benchmark baseline update main
- name: Check benchmark delta
id: check_delta
run: |
echo $(date) >> $GITHUB_STEP_SUMMARY
echo "BENCHMARK_STATUS=1" >> "$GITHUB_OUTPUT"
cd Benchmarks
swift package benchmark baseline check main pr --format markdown >> $GITHUB_STEP_SUMMARY
echo "BENCHMARK_STATUS=0" >> "$GITHUB_OUTPUT"
continue-on-error: true
- name: Exit with correct status
run: |
exit ${{ steps.check_delta.outputs.BENCHMARK_STATUS }}