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

Connect ASV benchmarking to CI #496

Merged
merged 6 commits into from
Oct 30, 2023
Merged
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
79 changes: 79 additions & 0 deletions .github/workflows/asv-benchmarking.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: ASV Benchmarking

on:
push:
branches:
- main
workflow_dispatch:
release:
types:
- published

jobs:
benchmark:
runs-on: ubuntu-latest
env:
CONDA_ENV_FILE: ./build_envs/asv-bench.yml
ASV_DIR: ./benchmarks

steps:
- name: Checkout geocat-comp
uses: actions/checkout@v4
with:
repository: NCAR/geocat-comp
fetch-depth: 0
- name: Checkout geocat-comp-asv
uses: actions/checkout@v4
with:
repository: NCAR/geocat-comp-asv
persist-credentials: false
fetch-depth: 0
ref: main
path: geocat-comp-asv
- name: Set environment variables
run: |
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV

- name: Set up conda environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./build_envs/asv-bench.yml
environment-name: asv-bench
cache-environment: true
cache-environment-key: "benchmark-${{runner.os}}-${{runner.arch}}-${{env.TODAY}}"

- name: Copy existing results
run: |
if [ -d "geocat-comp-asv/results" ]; then
cp -r geocat-comp-asv/results benchmarks/
fi

- name: Run benchmarks
shell: bash -l {0}
id: benchmark
run: |
cd benchmarks
asv machine --machine GH-Actions --os ubuntu-latest --arch x64 --cpu "2-core unknown" --ram 7GB
asv run v2022.10.0..main --skip-existing --parallel
anissa111 marked this conversation as resolved.
Show resolved Hide resolved

- name: Commit and push benchmark results
run: |
if [ -d "geocat-comp-asv/results" ]; then
rm -r geocat-comp-asv/results
fi
cp -r benchmarks/results/ geocat-comp-asv/
cd geocat-comp-asv
git config --local user.email "[email protected]"
git config --local user.name "anissa111"
git add results
git commit -m "[🤖] Update benchmark results"
anissa111 marked this conversation as resolved.
Show resolved Hide resolved

- name: Push to geocat-comp-asv
if: github.ref == 'refs/heads/main' && github.repository == 'NCAR/geocat-comp'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.COMP_ASV_PAT }}
branch: main
force: true
repository: NCAR/geocat-comp-asv
directory: geocat-comp-asv
4 changes: 4 additions & 0 deletions docs/release-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ Bug Fixes
^^^^^^^^^
* Fix Python version in upstream CI by `Philip Chmielowiec`_ in (:pr:`436`)

Internal Changes
^^^^^^^^^^^^^^^^
* Add benchmarking to commits to main and tagged releases by `Anissa Zacharias`_ in (:pr:`496`)

v2023.10.0 (Oct 3, 2023)
-----------------------
This release adds a code of conduct, minor edits to our contributor's guide, and
Expand Down
Loading