Skip to content

Commit 123889f

Browse files
authored
Add CI benchmarks for real (workflow) (#106)
* Add CI benchmarks for real (workflow) * Condition on label * Bench some more
1 parent 5332394 commit 123889f

2 files changed

Lines changed: 63 additions & 2 deletions

File tree

.github/workflows/Benchmark.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Benchmark
2+
3+
on:
4+
pull_request:
5+
types: [labeled, opened, synchronize, reopened]
6+
7+
permissions:
8+
pull-requests: write
9+
10+
jobs:
11+
Benchmark:
12+
runs-on: ubuntu-latest
13+
if: contains(github.event.pull_request.labels.*.name, 'benchmark')
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: julia-actions/setup-julia@v2
17+
with:
18+
version: "1"
19+
- uses: julia-actions/cache@v2
20+
- name: Extract Package Name from Project.toml
21+
id: extract-package-name
22+
run: |
23+
PACKAGE_NAME=$(grep "^name" Project.toml | sed 's/^name = "\(.*\)"$/\1/')
24+
echo "::set-output name=package_name::$PACKAGE_NAME"
25+
- name: Build AirspeedVelocity
26+
run: |
27+
# Lightweight build step, as sometimes the runner runs out of memory:
28+
julia -e 'ENV["JULIA_PKG_PRECOMPILE_AUTO"]=0; import Pkg; Pkg.add("AirspeedVelocity")'
29+
julia -e 'ENV["JULIA_PKG_PRECOMPILE_AUTO"]=0; import Pkg; Pkg.build("AirspeedVelocity")'
30+
- name: Add ~/.julia/bin to PATH
31+
run: |
32+
echo "$HOME/.julia/bin" >> $GITHUB_PATH
33+
- name: Run benchmarks
34+
run: |
35+
echo $PATH
36+
ls -l ~/.julia/bin
37+
mkdir results
38+
benchpkg ${{ steps.extract-package-name.outputs.package_name }} --rev="${{github.event.repository.default_branch}},${{github.event.pull_request.head.sha}}" --url=${{ github.event.repository.clone_url }} --bench-on="${{github.event.repository.default_branch}}" --output-dir=results/ --tune
39+
- name: Create markdown table from benchmarks
40+
run: |
41+
benchpkgtable ${{ steps.extract-package-name.outputs.package_name }} --rev="${{github.event.repository.default_branch}},${{github.event.pull_request.head.sha}}" --input-dir=results/ --ratio > table.md
42+
echo '### Benchmark Results' > body.md
43+
echo '' >> body.md
44+
echo '' >> body.md
45+
cat table.md >> body.md
46+
echo '' >> body.md
47+
echo '' >> body.md
48+
- name: Find Comment
49+
uses: peter-evans/find-comment@v3
50+
id: fcbenchmark
51+
with:
52+
issue-number: ${{ github.event.pull_request.number }}
53+
comment-author: 'github-actions[bot]'
54+
body-includes: Benchmark Results
55+
- name: Comment on PR
56+
uses: peter-evans/create-or-update-comment@v4
57+
with:
58+
comment-id: ${{ steps.fcbenchmark.outputs.comment-id }}
59+
issue-number: ${{ github.event.pull_request.number }}
60+
body-path: body.md
61+
edit-mode: replace

benchmark/benchmarks.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ SUITE = BenchmarkGroup()
88
for structure in [:nonsymmetric, :symmetric],
99
partition in (structure == :nonsymmetric ? [:column, :row] : [:column]),
1010
decompression in (structure == :nonsymmetric ? [:direct] : [:direct, :substitution]),
11-
n in [10^3],
12-
p in [2 / n, 5 / n]
11+
n in [10^3, 10^5],
12+
p in [2 / n, 5 / n, 10 / n]
1313

1414
problem = ColoringProblem(; structure, partition)
1515
algo = GreedyColoringAlgorithm(; decompression)

0 commit comments

Comments
 (0)