Skip to content

asv

asv #72

Workflow file for this run

name: asv
on:
workflow_dispatch:
schedule:
- cron: 0 4 * * *
concurrency:
group: "pages"
cancel-in-progress: false
env:
NUM_BENCHMARK_COMMITS: 10
jobs:
asv:
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
# NOTE: This only grabs the HEAD commit of the main branch, so we can't
# use it for retrospective benchmarking. Instead, we manually
# pull the submodule in the next step
# with:
# submodules: 'true'
- name: Manually pull submodules
run: |
git config --global url."https://github.com/".insteadOf "[email protected]:" &&\
git submodule update --init &&\
cd xdsl &&\
git checkout main &&\
git pull
- uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
# Use `actions/setup-python@v5` rather than `uv python install 3.x` to
# ensure that it is correctly in the $PATH for `asv`
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install the project
run: VENV_ARGS="--only-group asv" make install
- name: Fingerprint the machine
run: |
echo "OS: `uname -sr`"
echo "Architecture: `uname -m`"
echo "CPU: `lscpu | grep 'Model name' | cut -f 2 -d ":" | awk '{$1=$1}1'`"
echo "Cores: `nproc --all`"
echo "RAM: `grep MemTotal /proc/meminfo | awk '{print $2}'`"
uv run asv machine -v --yes \
--machine github-action \
--os "`uname -sr`" \
--arch "`uname -m`" \
--cpu "`lscpu | grep 'Model name' | cut -f 2 -d ":" | awk '{$1=$1}1'`" \
--num_cpu `nproc --all` \
--ram `grep MemTotal /proc/meminfo | awk '{print $2}'`
- name: Run the ASV benchmarks
run: uv run asv run main~$NUM_BENCHMARK_COMMITS..main
- name: Generate the ASV website
run: uv run asv publish
- name: Commit the generated benchmark results
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Add CI benchmark runs"
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: .asv/html/
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4