Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run benchmarks in CI #261

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Benchmark
on:
push: { branches: [ "master" ] }
pull_request: { branches: [ "master" ] }

jobs:
asv:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- uses: conda-incubator/setup-miniconda@v2
with: { miniforge-variant: "Mambaforge", miniforge-version: "latest" }
- name: Install dependencies
shell: bash -l {0}
run: |
mamba env update --quiet -n test -f libeantic/environment.yml
conda list
- name: Checkout historic performance data
uses: actions/checkout@v2
with:
path: .asv/results
ref: asv
- name: Run benchmarks
uses: flatsurf/actions/asv@main
- name: Update historic performance data
uses: EndBug/add-and-commit@v5
with:
author_name: asv bot
author_email: [email protected]
message: 'record asv run'
cwd: .asv/results
branch: asv
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.event_name == 'push' }}
- uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: .asv/html
TARGET_FOLDER: asv
if: ${{ github.event_name == 'push' }}

env:
MAKEFLAGS: -j2
36 changes: 36 additions & 0 deletions asv.conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"version": 1,
"dvcs": "git",
"project": "e-antic",
"project_url": "https://github.com/flatsurf/e-antic",
"show_commit_url": "https://github.com/flatsurf/e-antic/commit/",
"repo": ".",
"environment_type": "conda",
"matrix": {
"arb": [],
"automake": [],
"benchmark==1.5.0": [],
"boost-cpp": [],
"ccache": [],
"flatsurf::cppasv": [],
"cxx-compiler": [],
"gmp": [],
"libtool": [],
"make": []
},
"conda_channels": ["conda-forge"],
"repo_subdir": "libeantic",
"build_command": [
"autoreconf -ivf",
"/bin/sh configure CXX='ccache c++'",
"make"
],
"install_command": [],
"uninstall_command": [],
"benchmark_dir": "tools/asv",
"env_dir": ".asv/env",
"results_dir": ".asv/results",
"html_dir": ".asv/html"
}


1 change: 1 addition & 0 deletions tools/asv/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/__pycache__
34 changes: 34 additions & 0 deletions tools/asv/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#*********************************************************************
# This file is part of e-antic.
#
# Copyright (C) 2019-2023 Julian Rüth
#
# e-antic is free software: you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 3.0 of the License, or (at your option)
# any later version.
#
# e-antic is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License
# along with e-antic. If not, see <https://www.gnu.org/licenses/>.
#*********************************************************************

import os
from os.path import join

from cppasv import create_wrappers

ASV_PROJECT_DIR = os.environ.get('ASV_PROJECT_DIR', None)

if not ASV_PROJECT_DIR:
ASV_ENV_DIR = os.environ.get('ASV_ENV_DIR', None)
if ASV_ENV_DIR:
ASV_PROJECT_DIR = join(ASV_ENV_DIR, "project")
else:
ASV_PROJECT_DIR = join(os.path.dirname(os.path.abspath(__file__)), "..", "..")

locals().update(create_wrappers(join(ASV_PROJECT_DIR, "libeantic", "benchmark", "benchmark")))