Skip to content

Commit 677622c

Browse files
committed
Use latest versions of action dependencies in example workflows
Some GitHub Actions workflows are provided in the readme to demonstrate the use of the action. These workflows have dependencies on the "actions/upload-artifact" and "actions/download-artifact" actions. Previously, these dependencies were pinned to their 3.x major version series. A 4.x major version series of the actions was recently started. It is best practices to use the latest version of actions, so the documentation should demonstrate that. A significant breaking change was introduced in the 4.0.0 release of "actions/upload-artifact": uploading multiple times to the same artifact is no longer allowed. Previously the "Workflow triggered by `pull_request` event" example workflow used a single artifact for the sketches report file produced by the matrix job for each of the boards the sketches were compiled for. It was necessary to adjust the configuration of the workflow to use a separate workflow for each of the sketches report files in order to accommodate the bump fo the "actions/upload-artifact" action dependency.
1 parent 155b44d commit 677622c

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

README.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
- uses: arduino/compile-sketches@v1
9999
with:
100100
enable-deltas-report: true
101-
- uses: actions/upload-artifact@v3
101+
- uses: actions/upload-artifact@v4
102102
with:
103103
name: sketches-reports
104104
path: sketches-reports
@@ -111,29 +111,30 @@ on: [push, pull_request]
111111
env:
112112
# It's convenient to set variables for values used multiple times in the workflow
113113
SKETCHES_REPORTS_PATH: sketches-reports
114-
SKETCHES_REPORTS_ARTIFACT_NAME: sketches-reports
115114
jobs:
116115
compile:
117116
runs-on: ubuntu-latest
118117
strategy:
119118
matrix:
120-
fqbn:
121-
- "arduino:avr:uno"
122-
- "arduino:samd:mkrzero"
119+
board:
120+
- fqbn: arduino:avr:uno
121+
artifact-name-suffix: arduino-avr-uno
122+
- fqbn: arduino:samd:mkrzero
123+
artifact-name-suffix: arduino-samd-mkrzero
123124
steps:
124125
- uses: actions/checkout@v4
125126
126127
- uses: arduino/compile-sketches@v1
127128
with:
128-
fqbn: ${{ matrix.fqbn }}
129+
fqbn: ${{ matrix.board.fqbn }}
129130
enable-deltas-report: true
130131
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
131132
132133
# This step is needed to pass the size data to the report job
133134
- name: Upload sketches report to workflow artifact
134-
uses: actions/upload-artifact@v3
135+
uses: actions/upload-artifact@v4
135136
with:
136-
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
137+
name: sketches-reports-${{ matrix.board.artifact-name-suffix }}
137138
path: ${{ env.SKETCHES_REPORTS_PATH }}
138139
139140
# When using a matrix to compile for multiple boards, it's necessary to use a separate job for the deltas report
@@ -143,10 +144,9 @@ jobs:
143144
runs-on: ubuntu-latest
144145
steps:
145146
# This step is needed to get the size data produced by the compile jobs
146-
- name: Download sketches reports artifact
147-
uses: actions/download-artifact@v3
147+
- name: Download sketches reports artifacts
148+
uses: actions/download-artifact@v4
148149
with:
149-
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
150150
path: ${{ env.SKETCHES_REPORTS_PATH }}
151151
152152
- uses: arduino/report-size-deltas@v1

0 commit comments

Comments
 (0)