@@ -45,16 +45,37 @@ jobs:
45
45
key : v4-build-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }}
46
46
- name : run tox
47
47
run : tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- --benchmark-json=${{ env.RUN_MATRIX_COMBINATION }}-benchmark.json
48
- - name : Find and merge benchmarks
48
+ - name : Find and merge ${{ matrix.package }} benchmarks
49
49
# TODO: Add at least one benchmark to every package type to remove this (#249)
50
50
if : matrix.package == 'sdkextension' || matrix.package == 'propagator'
51
51
run : >-
52
+ mkdir -p benchmarks;
52
53
jq -s '.[0].benchmarks = ([.[].benchmarks] | add)
53
54
| if .[0].benchmarks == null then null else .[0] end'
54
- **/**/tests/*${{ matrix.package }}*-benchmark.json > output.json
55
+ **/**/tests/*${{ matrix.package }}*-benchmark.json > benchmarks/output_${{ matrix.package }}.json
56
+ - name : upload layer arn artifact
57
+ if : ${{ success() }}
58
+ uses : actions/upload-artifact@v2
59
+ with :
60
+ name : benchmarks
61
+ path : benchmarks/output_${{ matrix.package }}.json
62
+ combine-benchmarks :
63
+ runs-on : ubuntu-latest
64
+ needs : build
65
+ if : ${{ always() }}
66
+ name : Combine benchmarks from previous build job
67
+ steps :
68
+ - name : download layerARNs
69
+ uses : actions/download-artifact@v2
70
+ with :
71
+ name : benchmarks
72
+ path : benchmarks
73
+ - name : Find and merge all benchmarks
74
+ run : >-
75
+ jq -s '.[0].benchmarks = ([.[].benchmarks] | add)
76
+ | if .[0].benchmarks == null then null else .[0] end'
77
+ benchmarks/output_*.json > output.json;
55
78
- name : Report on benchmark results
56
- # TODO: Add at least one benchmark to every package type to remove this (#249)
57
- if : matrix.package == 'sdkextension' || matrix.package == 'propagator'
58
79
uses : benchmark-action/github-action-benchmark@v1
59
80
with :
60
81
name : OpenTelemetry Python Benchmarks - Python ${{ env[matrix.python-version ]}} - ${{ matrix.package }}
0 commit comments