Merge pull request #3239 from ianshmean/ib/ci_benchmark

Add basic CI Benchmarking via BenchmarkCI
This commit is contained in:
Daniel Schwabeneder 2021-01-24 21:02:02 +00:00 committed by GitHub
commit 99ca1074de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 48 additions and 0 deletions

31
.github/workflows/benchmark.yml vendored Normal file
View File

@ -0,0 +1,31 @@
name: Run benchmarks
on:
pull_request:
jobs:
Benchmark:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
env:
GKS_ENCODING: "utf8"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
with:
version: 1
## Setup
- name: Ubuntu TESTCMD
run: echo "TESTCMD=xvfb-run --auto-servernum julia" >> $GITHUB_ENV
- name: Install Plots dependencies
uses: julia-actions/julia-buildpkg@latest
- name: Install Benchmarking dependencies
run: julia -e 'using Pkg; pkg"add PkgBenchmark BenchmarkCI@0.1"'
- name: Run benchmarks
run: $TESTCMD -e 'using BenchmarkCI; BenchmarkCI.judge()'
- name: Post results
run: julia -e 'using BenchmarkCI; BenchmarkCI.postjudge()'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

2
.gitignore vendored
View File

@ -10,3 +10,5 @@ deps/deps.jl
Manifest.toml Manifest.toml
dev/ dev/
test/tmpplotsave.hdf5 test/tmpplotsave.hdf5
/.benchmarkci
/benchmark/*.json

5
benchmark/Project.toml Normal file
View File

@ -0,0 +1,5 @@
[deps]
BenchmarkCI = "20533458-34a3-403d-a444-e18f38190b5b"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
PkgBenchmark = "32113eaa-f34f-5b0d-bd6c-c81e245fc73d"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"

10
benchmark/benchmarks.jl Normal file
View File

@ -0,0 +1,10 @@
using BenchmarkTools
const SUITE = BenchmarkGroup()
julia_cmd = get(ENV, "TESTCMD", Base.JLOptions().julia_bin)
# numbered to enforce sequence
SUITE["1_load_plot_display"] = @benchmarkable run(`sh -c $("$julia_cmd --startup-file=no -e 'using Plots; display(plot(1:0.1:10, sin.(1:0.1:10))))'")`)
SUITE["2_load"] = @benchmarkable run(`sh -c $("$julia_cmd --startup-file=no -e 'using Plots'")`)
SUITE["3_plot"] = @benchmarkable p = plot(1:0.1:10, sin.(1:0.1:10)) setup(@eval(using Plots))
SUITE["4_display"] = @benchmarkable display(p) setup=(@eval(using Plots); p = plot(1:0.1:10, sin.(1:0.1:10)))