From d1b989c4fa88838b9a52fcfd28234d391cc6c284 Mon Sep 17 00:00:00 2001
From: per1234 <accounts@perglass.com>
Date: Fri, 2 Apr 2021 02:05:53 -0700
Subject: [PATCH 1/2] Update action versions used in CI workflows

The "smoke test" sketch compilation and reporting actions have been moved to dedicated repositories. The actions hosted
at the old `arduino/actions/libraries/*` location will no longer be maintained.

Since the time the actions were migrated to the dedicated repositories, a breaking change was made to the default value
of the `sketches-report-path` input, which required a change to the values of the `name` and `path` inputs of the
`actions/upload-artifact` action.
---
 .github/workflows/compile-examples.yml   | 9 +++++----
 .github/workflows/report-size-deltas.yml | 2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml
index 28e61cad..9dfbf70a 100644
--- a/.github/workflows/compile-examples.yml
+++ b/.github/workflows/compile-examples.yml
@@ -54,6 +54,7 @@ jobs:
         - ~/Arduino/libraries/Arduino_LPS22HB/examples
         - ~/Arduino/libraries/ArduinoDMX/examples
         - ~/Arduino/libraries/ArduinoRS485/examples
+      SKETCHES_REPORTS_PATH: sketches-reports
 
     strategy:
       fail-fast: false
@@ -108,7 +109,7 @@ jobs:
           # CapacitiveSensor library does not support megaAVR core yet
           rm -r "$GITHUB_WORKSPACE/extras/examples/10.StarterKit_BasicKit/p13_TouchSensorLamp"
       - name: Compile examples
-        uses: arduino/actions/libraries/compile-examples@master
+        uses: arduino/compile-sketches@v1
         with:
           github-token: ${{ secrets.GITHUB_TOKEN }}
           fqbn: ${{ matrix.board.fqbn }}
@@ -147,7 +148,7 @@ jobs:
           verbose: 'true'
 
       - name: Save memory usage change report as artifact
-        uses: actions/upload-artifact@v1
+        uses: actions/upload-artifact@v2
         with:
-          name: size-deltas-reports
-          path: size-deltas-reports
+          path: ${{ env.SKETCHES_REPORTS_PATH }}
+          name: ${{ env.SKETCHES_REPORTS_PATH }}
diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml
index a359b257..b30c25be 100644
--- a/.github/workflows/report-size-deltas.yml
+++ b/.github/workflows/report-size-deltas.yml
@@ -10,4 +10,4 @@ jobs:
 
     steps:
       - name: Comment size deltas reports to PRs
-        uses: arduino/actions/libraries/report-size-deltas@master
\ No newline at end of file
+        uses: arduino/report-size-deltas@v1

From a95aef69c34c199cffd2478a02210039c1e860b4 Mon Sep 17 00:00:00 2001
From: per1234 <accounts@perglass.com>
Date: Fri, 2 Apr 2021 02:07:19 -0700
Subject: [PATCH 2/2] Specify sketches report input values for sketch
 compilation CI actions

The reliance on the `actions/upload-artifacts` action as the transfer mechanism between workflow runs means that these
values will always be hardcoded into the workflow. The result is that if the default values of the inputs are changed, it
breaks the workflow, even if the changes are synchronized. So it's more robust to avoid dependening on the default
values.
---
 .github/workflows/compile-examples.yml   | 1 +
 .github/workflows/report-size-deltas.yml | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml
index 9dfbf70a..db79dd1d 100644
--- a/.github/workflows/compile-examples.yml
+++ b/.github/workflows/compile-examples.yml
@@ -146,6 +146,7 @@ jobs:
             ${{ matrix.additional-sketch-paths }}
           enable-deltas-report: 'true'
           verbose: 'true'
+          sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
 
       - name: Save memory usage change report as artifact
         uses: actions/upload-artifact@v2
diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml
index b30c25be..1e37a511 100644
--- a/.github/workflows/report-size-deltas.yml
+++ b/.github/workflows/report-size-deltas.yml
@@ -11,3 +11,6 @@ jobs:
     steps:
       - name: Comment size deltas reports to PRs
         uses: arduino/report-size-deltas@v1
+        with:
+          # The name of the workflow artifact created by the sketch compilation workflow
+          sketches-reports-source: sketches-reports