Skip to content

Commit c962da9

Browse files
authored
Merge parallel benchmarks + include propagator + latest GH action (#838)
* Include propagator benchmarks + latest GH action * When we moved the aws-xray propagator in #720, we needed to update the benchmark step of the workflow * Additionally, the GH action has evolved since we added benchmarks so we should use the latest version * Merge all parallel benchmarks after they complete
1 parent 9219677 commit c962da9

File tree

1 file changed

+29
-6
lines changed

1 file changed

+29
-6
lines changed

Diff for: .github/workflows/test.yml

+29-6
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,40 @@ 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)
50-
if: matrix.package == 'sdkextension'
50+
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 all benchmarks under same key as an 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: Checkout Contrib Repo @ SHA - ${{ github.sha }}
69+
uses: actions/checkout@v2
70+
- name: Download all benchmarks as artifact using key
71+
uses: actions/download-artifact@v2
72+
with:
73+
name: benchmarks
74+
path: benchmarks
75+
- name: Find and merge all benchmarks
76+
run: >-
77+
jq -s '.[0].benchmarks = ([.[].benchmarks] | add)
78+
| if .[0].benchmarks == null then null else .[0] end'
79+
benchmarks/output_*.json > output.json;
5580
- 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'
58-
uses: rhysd/github-action-benchmark@v1
81+
uses: benchmark-action/github-action-benchmark@v1
5982
with:
6083
name: OpenTelemetry Python Benchmarks - Python ${{ env[matrix.python-version ]}} - ${{ matrix.package }}
6184
tool: pytest

0 commit comments

Comments
 (0)