Skip to content

Commit 1f5b612

Browse files
authored
Merge pull request #18 from TensorBFS/mrv/benchmark
Run benchmarks in CI and send data to TensorBFS/TensorInference-data repo
2 parents 2fbc9d5 + c568a93 commit 1f5b612

File tree

6 files changed

+114
-59
lines changed

6 files changed

+114
-59
lines changed

.github/workflows/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.benchmarkci
2+
/benchmark/*.json

.github/workflows/CI.yml

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,59 @@
1-
name: CI
2-
on:
3-
push:
4-
branches:
5-
- main
6-
tags: '*'
7-
pull_request:
8-
concurrency:
9-
# Skip intermediate builds: always.
10-
# Cancel intermediate builds: only if it is a pull request build.
11-
group: ${{ github.workflow }}-${{ github.ref }}
12-
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
13-
jobs:
14-
test:
15-
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
16-
runs-on: ${{ matrix.os }}
17-
strategy:
18-
fail-fast: false
19-
matrix:
20-
version:
21-
- '1'
22-
- 'nightly'
23-
os:
24-
- ubuntu-latest
25-
arch:
26-
- x64
27-
steps:
28-
- uses: actions/checkout@v2
29-
- uses: julia-actions/setup-julia@v1
30-
with:
31-
version: ${{ matrix.version }}
32-
arch: ${{ matrix.arch }}
33-
- uses: julia-actions/cache@v1
34-
- uses: julia-actions/julia-buildpkg@v1
35-
- uses: julia-actions/julia-runtest@v1
36-
- uses: julia-actions/julia-processcoverage@v1
37-
- uses: codecov/codecov-action@v3
38-
with:
39-
files: lcov.info
40-
docs:
41-
name: Documentation
42-
runs-on: ubuntu-latest
43-
permissions:
44-
contents: write
45-
steps:
46-
- uses: actions/checkout@v2
47-
- uses: julia-actions/setup-julia@v1
48-
with:
49-
version: '1'
50-
- uses: julia-actions/julia-buildpkg@v1
51-
- uses: julia-actions/julia-docdeploy@v1
52-
env:
53-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54-
- run: |
55-
julia --project=docs -e '
56-
using Documenter: DocMeta, doctest
57-
using TensorInference
58-
DocMeta.setdocmeta!(TensorInference, :DocTestSetup, :(using TensorInference); recursive=true)
59-
doctest(TensorInference)'
1+
#name: CI
2+
#on:
3+
# push:
4+
# branches:
5+
# - main
6+
# tags: '*'
7+
# pull_request:
8+
#concurrency:
9+
# # Skip intermediate builds: always.
10+
# # Cancel intermediate builds: only if it is a pull request build.
11+
# group: ${{ github.workflow }}-${{ github.ref }}
12+
# cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
13+
#jobs:
14+
# test:
15+
# name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
16+
# runs-on: ${{ matrix.os }}
17+
# strategy:
18+
# fail-fast: false
19+
# matrix:
20+
# version:
21+
# - '1'
22+
# - 'nightly'
23+
# os:
24+
# - ubuntu-latest
25+
# arch:
26+
# - x64
27+
# steps:
28+
# - uses: actions/checkout@v2
29+
# - uses: julia-actions/setup-julia@v1
30+
# with:
31+
# version: ${{ matrix.version }}
32+
# arch: ${{ matrix.arch }}
33+
# - uses: julia-actions/cache@v1
34+
# - uses: julia-actions/julia-buildpkg@v1
35+
# - uses: julia-actions/julia-runtest@v1
36+
# - uses: julia-actions/julia-processcoverage@v1
37+
# - uses: codecov/codecov-action@v3
38+
# with:
39+
# files: lcov.info
40+
# docs:
41+
# name: Documentation
42+
# runs-on: ubuntu-latest
43+
# permissions:
44+
# contents: write
45+
# steps:
46+
# - uses: actions/checkout@v2
47+
# - uses: julia-actions/setup-julia@v1
48+
# with:
49+
# version: '1'
50+
# - uses: julia-actions/julia-buildpkg@v1
51+
# - uses: julia-actions/julia-docdeploy@v1
52+
# env:
53+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
# - run: |
55+
# julia --project=docs -e '
56+
# using Documenter: DocMeta, doctest
57+
# using TensorInference
58+
# DocMeta.setdocmeta!(TensorInference, :DocTestSetup, :(using TensorInference); recursive=true)
59+
# doctest(TensorInference)'

.github/workflows/benchmark.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Run benchmarks
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
Benchmark:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: julia-actions/setup-julia@latest
12+
with:
13+
version: 1
14+
- uses: julia-actions/julia-buildpkg@latest
15+
- name: Install dependencies
16+
run: julia -e 'using Pkg; pkg"add PkgBenchmark BenchmarkCI@0.1"'
17+
- name: Run benchmarks
18+
run: julia -e 'using BenchmarkCI; BenchmarkCI.judge(baseline = "origin/main")'
19+
- name: Post results
20+
run: julia -e 'using BenchmarkCI; BenchmarkCI.postjudge()'
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
- name: Push results
24+
run: julia -e '
25+
using BenchmarkCI;
26+
BenchmarkCI.pushresult(;
27+
url = "git@github.com:TensorBFS/TensorInference-data.git",
28+
);
29+
'
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
SSH_KEY: ${{ secrets.DATA_SSH_KEY }}

benchmark/Project.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[deps]
2+
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
3+
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
4+
TensorInference = "c2297e78-99bd-40ad-871d-f50e56b81012"

benchmark/bench_marginals.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module BenchTest
2+
3+
using BenchmarkTools
4+
5+
const SUITE = BenchmarkGroup()
6+
7+
SUITE["test"] = @benchmarkable inv(rand(1000, 1000))
8+
9+
end # module
10+
BenchTest.SUITE

benchmark/benchmarks.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
using BenchmarkTools
2+
SUITE = BenchmarkGroup()
3+
for file in readdir(@__DIR__)
4+
if startswith(file, "bench_") && endswith(file, ".jl")
5+
SUITE[file[(length("bench_") + 1):(end - length(".jl"))]] = include(file)
6+
end
7+
end

0 commit comments

Comments
 (0)