Skip to content

Commit 68dc658

Browse files
committed
debug benchmark post-processing
1 parent 0f8b521 commit 68dc658

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

.github/workflows/benchmark.yml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: FloPy benchmarks
22

33
on:
4+
push:
45
schedule:
56
- cron: '0 8 * * *' # run at 8 AM UTC (12 am PST)
67

@@ -57,15 +58,13 @@ jobs:
5758
if: failure()
5859
with:
5960
name: failed-benchmark-${{ matrix.os }}-${{ matrix.python-version }}-${{ github.run_id }}
60-
path: |
61-
./autotest/.failed/**
61+
path: autotest/.failed/**
6262

6363
- name: Upload benchmark result artifact
6464
uses: actions/upload-artifact@v3
6565
with:
6666
name: benchmarks-${{ matrix.os }}-${{ matrix.python-version }}-${{ github.run_id }}
67-
path: |
68-
./autotest/.benchmarks/**/*.json
67+
path: autotest/.benchmarks/**/*.json
6968

7069
post_benchmark:
7170
needs:
@@ -96,11 +95,17 @@ jobs:
9695
- name: Download all artifacts
9796
uses: actions/download-artifact@v3
9897
with:
99-
path: ./autotest/.benchmarks
98+
path: autotest/.benchmarks
10099

101100
- name: Process benchmark results
102101
run: |
103-
artifact_json=$(gh api -X GET -H "Accept: application/vnd.github+json" /repos/modflowpy/flopy/actions/artifacts)
102+
repo="${{ github.repository }}"
103+
path="autotest/.benchmarks"
104+
105+
# list benchmark artifacts
106+
artifact_json=$(gh api -X GET -H "Accept: application/vnd.github+json" /repos/$repo/actions/artifacts)
107+
108+
# get artifact ids and download artifacts
104109
get_artifact_ids="
105110
import json
106111
import sys
@@ -113,12 +118,16 @@ jobs:
113118
"
114119
echo $artifact_json \
115120
| python -c "$get_artifact_ids" \
116-
| xargs -I@ bash -c "gh api -H 'Accept: application/vnd.github+json' /repos/modflowpy/flopy/actions/artifacts/@/zip >> ./autotest/.benchmarks/@.zip"
117-
zipfiles=( ./autotest/.benchmarks/*.zip )
121+
| xargs -I@ bash -c "gh api -H 'Accept: application/vnd.github+json' /repos/$repo/actions/artifacts/@/zip >> $path/@.zip"
122+
123+
# unzip artifacts
124+
zipfiles=( $path/*.zip )
118125
if (( ${#zipfiles[@]} )); then
119-
unzip -o './autotest/.benchmarks/*.zip' -d ./autotest/.benchmarks
126+
unzip -o "$path/*.zip" -d $path
120127
fi
121-
python ./scripts/process_benchmarks.py ./autotest/.benchmarks ./autotest/.benchmarks
128+
129+
# process benchmarks
130+
python scripts/process_benchmarks.py $path $path
122131
env:
123132
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124133

@@ -127,5 +136,5 @@ jobs:
127136
with:
128137
name: benchmarks-${{ github.run_id }}
129138
path: |
130-
./autotest/.benchmarks/*.csv
131-
./autotest/.benchmarks/*.png
139+
autotest/.benchmarks/*.csv
140+
autotest/.benchmarks/*.png

0 commit comments

Comments
 (0)