From 1902eb5ac49e7dc77ccfb57bb9c23940ee67ef22 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Wed, 21 Feb 2024 19:04:44 +0100 Subject: [PATCH 1/2] Revert "Fix regression: report size delta size on PR. (#143)" This reverts commit d599067b07da0d6cdad783205f17d809631d3623. --- .github/workflows/compile-examples.yml | 21 ++------------------- .github/workflows/report-size-deltas.yml | 18 ++++++++++++++++++ .gitignore | 1 - 3 files changed, 20 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/report-size-deltas.yml delete mode 100644 .gitignore diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 372b465..aae4de7 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -19,15 +19,13 @@ on: # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#workflow_dispatch workflow_dispatch: -env: - SKETCHES_REPORTS_PATH: sketches-reports - jobs: - compile: + build: name: ${{ matrix.board.fqbn }} runs-on: ubuntu-latest env: + SKETCHES_REPORTS_PATH: sketches-reports # Libraries to install for all boards UNIVERSAL_LIBRARIES: | # Install the ArduinoModbus library from the local path @@ -119,18 +117,3 @@ jobs: if-no-files-found: error name: sketches-report-${{ matrix.board.artifact-name-suffix }} path: ${{ env.SKETCHES_REPORTS_PATH }} - - report: - needs: compile - if: github.event_name == 'pull_request' - runs-on: ubuntu-latest - - steps: - - name: Download sketches reports artifacts - uses: actions/download-artifact@v4 - with: - path: ${{ env.SKETCHES_REPORTS_PATH }} - - - uses: arduino/report-size-deltas@v1 - with: - sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }} diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml new file mode 100644 index 0000000..6fce082 --- /dev/null +++ b/.github/workflows/report-size-deltas.yml @@ -0,0 +1,18 @@ +name: Report Size Deltas + +on: + schedule: + - cron: "*/5 * * * *" + # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#workflow_dispatch + workflow_dispatch: + +jobs: + report: + runs-on: ubuntu-latest + + steps: + - name: Comment size deltas reports to PRs + uses: arduino/report-size-deltas@v1 + with: + # The name of the workflow artifact created by the "Compile Examples" workflow + sketches-reports-source: sketches-reports diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 9f11b75..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.idea/ From 2cd6add1b6f02dba4568a4f6edcbeb1dde6757fb Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Wed, 21 Feb 2024 19:05:15 +0100 Subject: [PATCH 2/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 | 4 ++-- .gitignore | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml index 6fce082..067c504 100644 --- a/.github/workflows/report-size-deltas.yml +++ b/.github/workflows/report-size-deltas.yml @@ -14,5 +14,5 @@ jobs: - name: Comment size deltas reports to PRs uses: arduino/report-size-deltas@v1 with: - # The name of the workflow artifact created by the "Compile Examples" workflow - sketches-reports-source: sketches-reports + # 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 new file mode 100644 index 0000000..9f11b75 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea/