-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (51 loc) · 1.7 KB
/
ci.yaml
File metadata and controls
60 lines (51 loc) · 1.7 KB
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
52
53
54
55
56
57
58
59
60
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [g++, clang++]
steps:
- uses: actions/checkout@v4
- name: Configure
run: cmake -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=${{ matrix.compiler }}
- name: Build
run: cmake --build build --config Debug
- name: Test
run: cd build && ctest --output-on-failure
benchmark-and-plot:
needs: build-and-test
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Python dependencies
run: pip install matplotlib numpy
- name: Configure and build benchmarks
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --target cpp-reference-benchmark_benchmarks
- name: Run benchmarks and capture output
run: |
./build/benchmarks/cpp-reference-benchmark_benchmarks --benchmark_format=console > benchmark_output.txt 2>&1
- name: Generate plot
run: python scripts/plot_benchmarks.py benchmark_output.txt
- name: Commit and push benchmark chart
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add benchmark_chart.png
git diff --staged --quiet || git commit -m "Update benchmark chart [skip ci]"
git push