Skip to content

Bump codecov/codecov-action from 5.1.1 to 5.1.2 (#669) #103

Bump codecov/codecov-action from 5.1.1 to 5.1.2 (#669)

Bump codecov/codecov-action from 5.1.1 to 5.1.2 (#669) #103

name: ASV Benchmarking
on:
push:
branches:
- main
workflow_dispatch:
jobs:
benchmark:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
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: Setup Miniforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: "24.1.2-0"
activate-environment: asv-bench
- name: Get date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash
- name: Cache environment
uses: actions/cache@v4
with:
path: ${{ env.CONDA }}/envs
key:
conda-${{ runner.os }}--${{ runner.arch }}--${{
steps.get-date.outputs.today }}-${{
hashFiles('./build_envs/asv-bench.yml') }}-${{ env.CACHE_NUMBER}}
env:
# Increase this value to reset cache if the environment file has not changed
CACHE_NUMBER: 0
id: cache
- name: Update environment
run:
conda env update -n asv-bench -f
./build_envs/asv-bench.yml
if: steps.cache.outputs.cache-hit != 'true'
- name: Conda list
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
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