asv #74
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: asv | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: 0 4 * * * | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
env: | |
NUM_BENCHMARK_COMMITS: 3 | |
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 | |
3.13 | |
- name: Check Python installations | |
run: | | |
which python3.12 && python3.12 --version | |
which python3.13 && python3.13 --version | |
- 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 |