Skip to content

Commit

Permalink
Don't upload multiple times to same artifact in "Compare Performance"…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
per1234 committed Oct 20, 2024
1 parent a2819b5 commit 7a44068
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/compare-performance.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Compare Performance

env:
REPORTS_ARTIFACT_NAME: reports
REPORTS_ARTIFACT_PREFIX: reports-

# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
on:
Expand Down Expand Up @@ -85,16 +85,20 @@ jobs:
matrix:
data:
# Use two copies of each job to catch job-specific anomalous durations.
- ref: ${{ github.ref }} # The tip of the branch selected in the workflow dispatch dialog's "Use workflow from" menu
- artifact-suffix: tip-run-1
ref: ${{ github.ref }} # The tip of the branch selected in the workflow dispatch dialog's "Use workflow from" menu
description: tip run 1
position: after
- ref: ${{ github.ref }}
- artifact-suffix: tip-run-2
ref: ${{ github.ref }}
description: tip run 2
position: after
- ref: ${{ needs.init.outputs.base-ref }}
- artifact-suffix: comparison-run-1
ref: ${{ needs.init.outputs.base-ref }}
description: comparison run 1
position: before
- ref: ${{ needs.init.outputs.base-ref }}
- artifact-suffix: comparison-run-2
ref: ${{ needs.init.outputs.base-ref }}
description: comparison run 2
position: before

Expand Down Expand Up @@ -298,7 +302,7 @@ jobs:
with:
if-no-files-found: error
path: ${{ env.REPORTS_PATH }}
name: ${{ env.REPORTS_ARTIFACT_NAME }}
name: ${{ env.REPORTS_ARTIFACT_PREFIX }}${{ matrix.data.ref }}

results:
needs: run
Expand All @@ -312,8 +316,9 @@ jobs:
- name: Download reports
uses: actions/download-artifact@v4
with:
name: ${{ env.REPORTS_ARTIFACT_NAME }}
merge-multiple: true
path: ${{ env.REPORTS_PATH }}
pattern: ${{ env.REPORTS_ARTIFACT_PREFIX }}*

- name: Print results
shell: python
Expand Down

0 comments on commit 7a44068

Please sign in to comment.