Skip to content

Commit 7a44068

Browse files
committed
Don't upload multiple times to same artifact in "Compare Performance" workflow
The "Compare Performance" GitHub Actions workflow is configured to time indexing runs at the tip ref, and then do the same for the base ref. The times are then compared to provide information regarding whether a proposed change would have a significant performance impact. This is done by using a job matrix in the GitHub Actions workflow to perform each of the runs in a parallel GitHub Actions workflow job. A GitHub Actions workflow artifact was used to transfer the files containing the data for each run between sequential jobs in the workflow. The "actions/upload-artifact" and "actions/download-artifact" actions are used for this purpose. Previously, a single artifact was used for the transfer of all the files, with each of the parallel jobs uploading its own generated files to that artifact. However, support for uploading multiple times to a single artifact was dropped in version 4.0.0 of the "actions/upload-artifact" action. So it is now necessary to use a dedicated artifact for each of the builds. These can be downloaded in aggregate by using the artifact name globbing and merging features which were introduced in version 4.1.0 of the "actions/download-artifact" action.
1 parent a2819b5 commit 7a44068

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

.github/workflows/compare-performance.yml

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Compare Performance
22

33
env:
4-
REPORTS_ARTIFACT_NAME: reports
4+
REPORTS_ARTIFACT_PREFIX: reports-
55

66
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
77
on:
@@ -85,16 +85,20 @@ jobs:
8585
matrix:
8686
data:
8787
# Use two copies of each job to catch job-specific anomalous durations.
88-
- ref: ${{ github.ref }} # The tip of the branch selected in the workflow dispatch dialog's "Use workflow from" menu
88+
- artifact-suffix: tip-run-1
89+
ref: ${{ github.ref }} # The tip of the branch selected in the workflow dispatch dialog's "Use workflow from" menu
8990
description: tip run 1
9091
position: after
91-
- ref: ${{ github.ref }}
92+
- artifact-suffix: tip-run-2
93+
ref: ${{ github.ref }}
9294
description: tip run 2
9395
position: after
94-
- ref: ${{ needs.init.outputs.base-ref }}
96+
- artifact-suffix: comparison-run-1
97+
ref: ${{ needs.init.outputs.base-ref }}
9598
description: comparison run 1
9699
position: before
97-
- ref: ${{ needs.init.outputs.base-ref }}
100+
- artifact-suffix: comparison-run-2
101+
ref: ${{ needs.init.outputs.base-ref }}
98102
description: comparison run 2
99103
position: before
100104

@@ -298,7 +302,7 @@ jobs:
298302
with:
299303
if-no-files-found: error
300304
path: ${{ env.REPORTS_PATH }}
301-
name: ${{ env.REPORTS_ARTIFACT_NAME }}
305+
name: ${{ env.REPORTS_ARTIFACT_PREFIX }}${{ matrix.data.ref }}
302306

303307
results:
304308
needs: run
@@ -312,8 +316,9 @@ jobs:
312316
- name: Download reports
313317
uses: actions/download-artifact@v4
314318
with:
315-
name: ${{ env.REPORTS_ARTIFACT_NAME }}
319+
merge-multiple: true
316320
path: ${{ env.REPORTS_PATH }}
321+
pattern: ${{ env.REPORTS_ARTIFACT_PREFIX }}*
317322

318323
- name: Print results
319324
shell: python

0 commit comments

Comments
 (0)