1
1
name : FloPy benchmarks
2
2
3
3
on :
4
+ push :
4
5
schedule :
5
6
- cron : ' 0 8 * * *' # run at 8 AM UTC (12 am PST)
6
7
@@ -57,15 +58,13 @@ jobs:
57
58
if : failure()
58
59
with :
59
60
name : failed-benchmark-${{ matrix.os }}-${{ matrix.python-version }}-${{ github.run_id }}
60
- path : |
61
- ./autotest/.failed/**
61
+ path : autotest/.failed/**
62
62
63
63
- name : Upload benchmark result artifact
64
64
uses : actions/upload-artifact@v3
65
65
with :
66
66
name : benchmarks-${{ matrix.os }}-${{ matrix.python-version }}-${{ github.run_id }}
67
- path : |
68
- ./autotest/.benchmarks/**/*.json
67
+ path : autotest/.benchmarks/**/*.json
69
68
70
69
post_benchmark :
71
70
needs :
@@ -96,11 +95,17 @@ jobs:
96
95
- name : Download all artifacts
97
96
uses : actions/download-artifact@v3
98
97
with :
99
- path : ./ autotest/.benchmarks
98
+ path : autotest/.benchmarks
100
99
101
100
- name : Process benchmark results
102
101
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
104
109
get_artifact_ids="
105
110
import json
106
111
import sys
@@ -113,12 +118,16 @@ jobs:
113
118
"
114
119
echo $artifact_json \
115
120
| 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 )
118
125
if (( ${#zipfiles[@]} )); then
119
- unzip -o './autotest/.benchmarks/ *.zip' -d ./autotest/.benchmarks
126
+ unzip -o "$path/ *.zip" -d $path
120
127
fi
121
- python ./scripts/process_benchmarks.py ./autotest/.benchmarks ./autotest/.benchmarks
128
+
129
+ # process benchmarks
130
+ python scripts/process_benchmarks.py $path $path
122
131
env :
123
132
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
124
133
@@ -127,5 +136,5 @@ jobs:
127
136
with :
128
137
name : benchmarks-${{ github.run_id }}
129
138
path : |
130
- ./ autotest/.benchmarks/*.csv
131
- ./ autotest/.benchmarks/*.png
139
+ autotest/.benchmarks/*.csv
140
+ autotest/.benchmarks/*.png
0 commit comments