From 8357f0bfc4ec64b440a5aa6a6840820694a99691 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Wed, 21 Feb 2024 19:17:47 +0100 Subject: [PATCH 1/2] Correct workflow artifact name pattern in size deltas report workflow The "sketches-reports-source" input of the "arduino/report-size-deltas" GitHub Actions action defines the regular expression that matches the names of the sketches report workflow artifacts produced by the "Compile Examples" workflow. The key string in the names of these artifacts was set to "sketches-report" when the "Compile Examples" workflow was adjusted for compatibility with the breaking changes introduced by updating to version 4.x of the workflow's "actions/upload-artifact" GitHub Actions action dependency. The pattern set in the size deltas report workflow was "sketches-reports". The "s" at the end of that pattern caused it to no longer match against the key string in the artifact names after that adjustment of the "Compile Examples" workflow, resulting in size deltas reports no longer being generated by the workflow. Although a minimal fix would be to simply remove the "s" from the end of the pattern, the decision was made to use a more strict regular expression. This will make it easier for maintainers and contributors to understand that this value is a regular expression and the exact nature of how that regular expression functions (which is less clear when relying on the "arduino/report-size-deltas" action's partial pattern matching behavior). --- .github/workflows/report-size-deltas.yml | 24 ++++++++++++++++++++++++ .gitignore | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/report-size-deltas.yml diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml new file mode 100644 index 0000000..39e2a0a --- /dev/null +++ b/.github/workflows/report-size-deltas.yml @@ -0,0 +1,24 @@ +name: Report Size Deltas + +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows +on: + push: + paths: + - ".github/workflows/report-size-deltas.yml" + schedule: + # Run at the minimum interval allowed by GitHub Actions. + # Note: GitHub Actions periodically has outages which result in workflow failures. + # In this event, the workflows will start passing again once the service recovers. + - cron: "*/5 * * * *" + workflow_dispatch: + repository_dispatch: + +jobs: + report: + runs-on: ubuntu-latest + steps: + - name: Comment size deltas reports to PRs + uses: arduino/report-size-deltas@v1 + with: + # Regex matching the names of the workflow artifacts created by the "Compile Examples" workflow + sketches-reports-source: ^sketches-report-.+ diff --git a/.gitignore b/.gitignore index 62c8935..9f11b75 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -.idea/ \ No newline at end of file +.idea/ From 8fee9fa6c9c952381905e340312376c3183e14ef Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Wed, 21 Feb 2024 19:28:31 +0100 Subject: [PATCH 2/2] Partially revert 92e8561e96ee4f500bc963213949276929e9b06c. --- .github/workflows/compile-examples.yml | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 5b8e261..f47759b 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -19,7 +19,7 @@ on: repository_dispatch: jobs: - compile: + build: name: ${{ matrix.board.fqbn }} runs-on: ubuntu-latest @@ -101,21 +101,3 @@ jobs: if-no-files-found: error path: ${{ env.SKETCHES_REPORTS_PATH }} name: sketches-report-${{ matrix.board.artifact-name-suffix }} - - # When using a matrix to compile for multiple boards, it's necessary to use a separate job for the deltas report - report: - needs: compile # Wait for the compile job to finish to get the data for the report - if: github.event_name == 'pull_request' # Only run the job when the workflow is triggered by a pull request - runs-on: ubuntu-latest - - steps: - # This step is needed to get the size data produced by the compile jobs - - name: Download sketches reports artifacts - uses: actions/download-artifact@v4 - with: - # All workflow artifacts will be downloaded to this location. - path: ${{ env.SKETCHES_REPORTS_PATH }} - - - uses: arduino/report-size-deltas@v1 - with: - sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}