-
Notifications
You must be signed in to change notification settings - Fork 0
162 lines (141 loc) · 4.35 KB
/
Copy pathbench.yml
File metadata and controls
162 lines (141 loc) · 4.35 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: Benchmark
on:
push:
branches: [main]
paths:
- "include/**"
- "benchmarks/**"
- "CMakeLists.txt"
- "Taskfile.yml"
- ".github/workflows/bench.yml"
workflow_dispatch:
permissions:
contents: write
concurrency:
group: benchmark-pages
cancel-in-progress: false
jobs:
linux:
name: Linux (${{ matrix.compiler }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- compiler: gcc
build_dir: build-gcc
- compiler: clang
build_dir: build-clang
steps:
- uses: actions/checkout@v7
- name: Install build dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build ccache clang
- name: Install Task
uses: go-task/setup-task@v2
with:
version: 3.x
- name: Setup uv
uses: astral-sh/setup-uv@v8.2.0
with:
enable-cache: true
cache-dependency-glob: |
pyproject.toml
uv.lock
- name: Cache deps
uses: actions/cache@v6
with:
path: ${{ matrix.build_dir }}/_deps
key: ${{ runner.os }}-${{ matrix.compiler }}-deps-${{ hashFiles('CMakeLists.txt', '**/CMakeLists.txt', '**/*.cmake') }}
restore-keys: |
${{ runner.os }}-${{ matrix.compiler }}-deps-
- name: Run benchmark via task
run: task bench-heavy:${{ matrix.compiler }}
- name: Upload benchmark artifacts
uses: actions/upload-artifact@v7
with:
name: benchmark-${{ runner.os }}-${{ matrix.compiler }}
if-no-files-found: warn
path: |
benchmarks/bench_summary.md
benchmarks/bench_IsPrime.webp
benchmarks/bench_IsPrimeNoTable.webp
benchmarks/bench_summary.webp
windows:
name: Windows (${{ matrix.compiler }})
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- compiler: msvc
build_dir: build-msvc
- compiler: clang-cl
build_dir: build-clang-cl
steps:
- uses: actions/checkout@v7
- name: Install LLVM + Ninja (clang-cl)
if: matrix.compiler == 'clang-cl'
shell: pwsh
run: |
choco install llvm ninja -y --no-progress
- name: Install Task
uses: go-task/setup-task@v2
with:
version: 3.x
- name: Setup uv
uses: astral-sh/setup-uv@v8.2.0
with:
enable-cache: true
cache-dependency-glob: |
pyproject.toml
uv.lock
- name: Cache deps
uses: actions/cache@v6
with:
path: ${{ matrix.build_dir }}/_deps
key: ${{ runner.os }}-${{ matrix.compiler }}-deps-${{ hashFiles('CMakeLists.txt', '**/CMakeLists.txt', '**/*.cmake') }}
restore-keys: |
${{ runner.os }}-${{ matrix.compiler }}-deps-
- name: Run benchmark via task
run: task bench-heavy:${{ matrix.compiler }}
- name: Upload benchmark artifacts
uses: actions/upload-artifact@v7
with:
name: benchmark-${{ runner.os }}-${{ matrix.compiler }}
if-no-files-found: warn
path: |
benchmarks/bench_summary.md
benchmarks/bench_IsPrime.webp
benchmarks/bench_IsPrimeNoTable.webp
benchmarks/bench_summary.webp
publish-pages:
name: Publish benchmark results to GitHub Pages
runs-on: ubuntu-latest
needs: [linux, windows]
concurrency:
group: gh-pages-deploy
cancel-in-progress: false
steps:
- uses: actions/checkout@v7
- name: Download benchmark artifacts
uses: actions/download-artifact@v8
with:
path: artifacts
pattern: benchmark-*
- name: Prepare Pages content
run: >-
python3 scripts/publish_benchmarks_to_pages.py
--artifacts-dir artifacts
--site-dir site
--repo "${{ github.repository }}"
--run-id "${{ github.run_id }}"
- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: site
keep_files: true
commit_message: "chore(bench): publish run ${{ github.run_id }}"