Skip to content

Workflow file for this run

name: Benchmarks
on:
push:
branches:
- main
env:
# GITHUB_TOKEN: ${{ secrets.OB_BENCH_TOKEN }}
RESULTS_DIR_ROOT: gh_pages
ASV_CONFIG: asv.conf.json
MACHINE_NAME: github-actions-x86 # to identify github actions machine as hostname changes everytime
jobs:
build:
# This workflow only runs on the origin org
#if: github.repository_owner == 'sgkit-dev'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # To fetch all commits to be able to generate benchmarks html
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install numpy meson meson-python ninja build asv
# sudo apt install libopenblas-dev # XXX
# pip install scipy_openblas32
# install a nightly OpenBLAS wheel
pip install -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple scipy-openblas32
python -c'import scipy_openblas32 as so; print(so.get_pkg_config())' > scipy_openblas.pc
export PKG_CONFIG_PATH=$PWD
echo ">>>> PKG_CONFIG" $PKG_CONFIG_PATH
cat scipy_openblas.pc
- name: Set and log asv machine configuration
run: |
asv machine --yes --config asv.conf.json
echo "Machine Configuration:"
cat ~/.asv-machine.json
rm ~/.asv-machine.json
echo "Setting machine name to $MACHINE_NAME"
asv machine --machine $MACHINE_NAME --yes --config $ASV_CONFIG -v
cat ~/.asv-machine.json
- name: Run benchmarks
run: |
echo ${{ github.workspace}}
asv run --config $ASV_CONFIG -v
asv publish --config $ASV_CONFIG -v
env:
PKG_CONFIG_PATH: ${{ github.workspace }}
- name: Copy results to a gh-pages branch clone
run: |
git clone -b gh-pages --single-branch https://github.com/OpenMathLib/BLAS-Benchmarks.git ~/$RESULTS_DIR_ROOT
echo ">>>> clone done"
RESULTS_DIR=~/$RESULTS_DIR_ROOT/results
if [ -d "$RESULTS_DIR" ]
then
echo ">> "results/$MACHINE_NAME
ls -l
cp -r $RESULTS_DIR/$MACHINE_NAME/* .asv/results/$MACHINE_NAME/
else
echo "results/ directory does not exist, creating"
mkdir -p $RESULTS_DIR
fi
asv publish --config $ASV_CONFIG -v
echo ">>> ."
ls -l .
echo ">>> .asv"
ls -l .asv
echo ">>> .asv/results"
ls -l .asv/results
cp -r .asv/html/* ~/$RESULTS_DIR_ROOT/
cp -r .asv/results ~/$RESULTS_DIR_ROOT/
echo ">>> @ " $RESULTS_DIR_ROOT
ls -l ~/$RESULTS_DIR_ROOT
- name: Push benchmarks
run: |
cd ~/$RESULTS_DIR_ROOT
git add .
git config --global user.email "project@openblas"
git config --global user.name "OB benchmark bot"
python -c'import scipy_openblas32 as sc; print(sc.__version__, "\n\n", sc.get_openblas_config())' > msg.txt
git commit -m "Update benchmarks `cat msg.txt` "
# git push origin main
git remote -v