File tree Expand file tree Collapse file tree 4 files changed +85
-1
lines changed Expand file tree Collapse file tree 4 files changed +85
-1
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ use_dev_shm=${USE_DEV_SHM:-true}
29
29
spack_debug=${SPACK_DEBUG:- false}
30
30
debug_mode=${DEBUG_MODE:- false}
31
31
push_to_registry=${PUSH_TO_REGISTRY:- true}
32
+ performance_tests=${PERFORMANCE_TESTS:- false}
32
33
33
34
# REGISTRY_TOKEN allows you to provide your own personal access token to the CI
34
35
# registry. Be sure to set the token with at least read access to the registry.
223
224
fi
224
225
225
226
# Test
226
- if [[ " ${option} " != " --build-only" ]]
227
+ if [[ " ${option} " != " --build-only" && " ${performance_tests} " != " true " ]]
227
228
then
228
229
229
230
if [[ ! -d ${build_dir} ]]
@@ -267,6 +268,27 @@ then
267
268
timed_message " Quandary tests completed"
268
269
fi
269
270
271
+ # Performance tests
272
+ if [[ " ${option} " != " --build-only" && " ${performance_tests} " == " true" ]]
273
+ then
274
+
275
+ cd ${project_dir}
276
+
277
+ timed_message " Performance tests for Quandary"
278
+
279
+ timed_message " Install python test dependencies"
280
+
281
+ eval ` ${spack_cmd} env activate ${spack_env_path} --sh`
282
+ python -m pip install -e . --prefer-binary
283
+
284
+ timed_message " Run performance tests"
285
+
286
+ mpi_exe=$( grep ' MPIEXEC_EXECUTABLE' " ${hostconfig_path} " | cut -d' "' -f2 | sed ' s/;/ /g' )
287
+ pytest -v -s performance_tests --mpi-exec=" ${mpi_exe} " --benchmark-json=benchmark_results.json
288
+
289
+ timed_message " Quandary performance tests completed"
290
+ fi
291
+
270
292
cd ${project_dir}
271
293
272
294
timed_message " Build and test completed"
Original file line number Diff line number Diff line change
1
+ name : Process Benchmark
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ inputs :
6
+ benchmark_data :
7
+ description : ' Base64 encoded benchmark data'
8
+ required : true
9
+ pull_request : # TODO remove this later
10
+ branches :
11
+ - main
12
+
13
+ jobs :
14
+ store-and-visualize :
15
+ runs-on : ubuntu-latest
16
+ steps :
17
+ - uses : actions/checkout@v3
18
+
19
+ - name : Decode benchmark data
20
+ run : echo "${{ github.event.inputs.benchmark_data }}" | base64 -d > benchmark.json
21
+
22
+ - name : Store benchmark result
23
+ uses : benchmark-action/github-action-benchmark@v1
24
+ with :
25
+ tool : ' pytest'
26
+ output-file-path : benchmark.json
27
+ github-token : ${{ secrets.GITHUB_TOKEN }}
28
+ auto-push : true
29
+ gh-pages-branch : gh-pages
30
+ benchmark-data-dir-path : dev/bench
31
+ comment-on-alert : true
32
+ alert-threshold : ' 120%'
33
+ max-items-in-chart : 100
Original file line number Diff line number Diff line change @@ -49,6 +49,24 @@ variables:
49
49
reports :
50
50
junit : junit.xml
51
51
52
+ .performance_job :
53
+ artifacts :
54
+ paths :
55
+ - benchmark_results.json
56
+ after_script :
57
+ - |
58
+ if [ -f "benchmark_results.json" ]; then
59
+ echo "Sending benchmark results to GitHub..."
60
+ BENCHMARK_DATA=$(base64 -w 0 benchmark_results.json)
61
+ curl -X POST \
62
+ -H "Authorization: token $GITHUB_TOKEN" \
63
+ -H "Accept: application/vnd.github.v3+json" \
64
+ https://api.github.com/repos/${GITHUB_PROJECT_ORG}/${GITHUB_PROJECT_NAME}/actions/workflows/benchmark.yml/dispatches \
65
+ -d "{\"ref\":\"main\",\"inputs\":{\"benchmark_data\":\"$BENCHMARK_DATA\"}}"
66
+ else
67
+ echo "benchmark_results.json not found, skipping GitHub API integration."
68
+ fi
69
+
52
70
.reproducer_vars :
53
71
script :
54
72
- |
Original file line number Diff line number Diff line change @@ -23,3 +23,14 @@ gcc_10_3_1:
23
23
variables :
24
24
SPEC : " ${PROJECT_RUBY_VARIANTS} %gcc@=10.3.1 ${PROJECT_RUBY_DEPS} ^mvapich2%gcc@=10.3.1"
25
25
extends : .job_on_ruby
26
+
27
+ # ###########
28
+ # Extra jobs
29
+ # ###########
30
+ performance_tests_clang_14_0_6 :
31
+ variables :
32
+ SPEC : " ${PROJECT_RUBY_VARIANTS} %clang@=14.0.6 ${PROJECT_RUBY_DEPS}"
33
+ PERFORMANCE_TESTS : " true"
34
+ extends :
35
+ - .job_on_ruby
36
+ - .performance_job
You can’t perform that action at this time.
0 commit comments