Removes ASV version pin and pin Conda version for ASV workflow #64
Workflow file for this run
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 Benchmarking | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
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: Cache conda | |
uses: actions/cache@v3 | |
env: | |
# Increase this value to reset cache if etc/example-environment.yml has not changed | |
CACHE_NUMBER: 0 | |
with: | |
path: ~/conda_pkgs_dir | |
key: | |
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ | |
hashFiles('./build_envs/asv-bench.yml') }} | |
- name: Set up conda environment | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
activate-environment: asv-bench | |
conda-version: "24.1.2" | |
environment-file: ./build_envs/asv-bench.yml | |
use-only-tar-bz2: true | |
run: | | |
conda info | |
conda list | |
- 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 v2023.02.0..main --skip-existing --parallel || true | |
- 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 "anissaz@ucar.edu" | |
git config --local user.name "anissa111" | |
git add results | |
git commit -m "[🤖] Update benchmark results" | |
- 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 |