From 94fc077622801fead498ef9776c4e2d461c93bbb Mon Sep 17 00:00:00 2001 From: wpbonelli Date: Tue, 14 Nov 2023 07:36:08 -0500 Subject: [PATCH] debug benchmark post-processing --- .github/workflows/benchmark.yml | 35 +++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 645b1d930a..eb72e5dca5 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -1,6 +1,7 @@ name: FloPy benchmarks on: + push: schedule: - cron: '0 8 * * *' # run at 8 AM UTC (12 am PST) @@ -12,7 +13,7 @@ jobs: fail-fast: false matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] - python-version: [ 3.8, 3.9, "3.10", "3.11", "3.12" ] + python-version: [ 3.8 ] # 3.9, "3.10", "3.11", "3.12" ] exclude: # avoid shutil.copytree infinite recursion bug # https://github.com/python/cpython/pull/17098 @@ -57,15 +58,13 @@ jobs: if: failure() with: name: failed-benchmark-${{ matrix.os }}-${{ matrix.python-version }}-${{ github.run_id }} - path: | - ./autotest/.failed/** + path: autotest/.failed/** - name: Upload benchmark result artifact uses: actions/upload-artifact@v3 with: name: benchmarks-${{ matrix.os }}-${{ matrix.python-version }}-${{ github.run_id }} - path: | - ./autotest/.benchmarks/**/*.json + path: autotest/.benchmarks/**/*.json post_benchmark: needs: @@ -96,11 +95,17 @@ jobs: - name: Download all artifacts uses: actions/download-artifact@v3 with: - path: ./autotest/.benchmarks + path: autotest/.benchmarks - name: Process benchmark results run: | - artifact_json=$(gh api -X GET -H "Accept: application/vnd.github+json" /repos/modflowpy/flopy/actions/artifacts) + repo="${{ github.repository }}" + path="autotest/.benchmarks" + + # list benchmark artifacts + artifact_json=$(gh api -X GET -H "Accept: application/vnd.github+json" /repos/$repo/actions/artifacts) + + # get artifact ids and download artifacts get_artifact_ids=" import json import sys @@ -113,12 +118,16 @@ jobs: " echo $artifact_json \ | python -c "$get_artifact_ids" \ - | xargs -I@ bash -c "gh api -H 'Accept: application/vnd.github+json' /repos/modflowpy/flopy/actions/artifacts/@/zip >> ./autotest/.benchmarks/@.zip" - zipfiles=( ./autotest/.benchmarks/*.zip ) + | xargs -I@ bash -c "gh api -H 'Accept: application/vnd.github+json' /repos/$repo/actions/artifacts/@/zip >> $path/@.zip" + + # unzip artifacts + zipfiles=( $path/*.zip ) if (( ${#zipfiles[@]} )); then - unzip -o './autotest/.benchmarks/*.zip' -d ./autotest/.benchmarks + unzip -o "$path/*.zip" -d $path fi - python ./scripts/process_benchmarks.py ./autotest/.benchmarks ./autotest/.benchmarks + + # process benchmarks + python scripts/process_benchmarks.py $path $path env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -127,5 +136,5 @@ jobs: with: name: benchmarks-${{ github.run_id }} path: | - ./autotest/.benchmarks/*.csv - ./autotest/.benchmarks/*.png + autotest/.benchmarks/*.csv + autotest/.benchmarks/*.png