Skip to content

Commit 177ce13

Browse files
committed
Merge all parallel benchmarks after they complete
1 parent 6d19272 commit 177ce13

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

.github/workflows/test.yml

+25-4
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,37 @@ jobs:
4545
key: v4-build-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }}
4646
- name: run tox
4747
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
4949
# TODO: Add at least one benchmark to every package type to remove this (#249)
5050
if: matrix.package == 'sdkextension' || matrix.package == 'propagator'
5151
run: >-
52+
mkdir -p benchmarks;
5253
jq -s '.[0].benchmarks = ([.[].benchmarks] | add)
5354
| 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;
5578
- 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'
5879
uses: benchmark-action/github-action-benchmark@v1
5980
with:
6081
name: OpenTelemetry Python Benchmarks - Python ${{ env[matrix.python-version ]}} - ${{ matrix.package }}

0 commit comments

Comments
 (0)