|
12 | 12 | - "examples/**" |
13 | 13 | - "src/**" |
14 | 14 |
|
| 15 | +env: |
| 16 | + # It's convenient to set variables for values used multiple times in the workflow. |
| 17 | + SKETCHES_REPORTS_PATH: sketches-reports |
| 18 | + |
15 | 19 | jobs: |
16 | | - build: |
| 20 | + compile: |
17 | 21 | runs-on: ubuntu-latest |
18 | 22 |
|
19 | 23 | env: |
|
31 | 35 | - examples/ArduinoIoTCloud-Callbacks |
32 | 36 | - examples/ArduinoIoTCloud-Schedule |
33 | 37 | - examples/utility/ArduinoIoTCloud_Travis_CI |
34 | | - SKETCHES_REPORTS_PATH: sketches-reports |
35 | 38 |
|
36 | 39 | strategy: |
37 | 40 | fail-fast: false |
@@ -292,9 +295,28 @@ jobs: |
292 | 295 | google-key-file: ${{ secrets.GOOGLE_KEY_FILE }} |
293 | 296 | spreadsheet-id: 1I6NZkpZpf8KugBkE92adB1Z3_b7ZepOpCdYTOigJpN4 |
294 | 297 |
|
| 298 | + # This step is needed to pass the size data to the report job. |
295 | 299 | - name: Save memory usage change report as artifact |
296 | 300 | if: github.event_name == 'pull_request' |
297 | 301 | uses: actions/upload-artifact@v4 |
298 | 302 | with: |
299 | 303 | name: sketches-report-${{ matrix.board.artifact-name-suffix }} |
300 | 304 | path: ${{ env.SKETCHES_REPORTS_PATH }} |
| 305 | + |
| 306 | + # When using a matrix to compile for multiple boards, it's necessary to use a separate job for the deltas report |
| 307 | + report: |
| 308 | + needs: compile # Wait for the compile job to finish to get the data for the report |
| 309 | + if: github.event_name == 'pull_request' # Only run the job when the workflow is triggered by a pull request |
| 310 | + runs-on: ubuntu-latest |
| 311 | + |
| 312 | + steps: |
| 313 | + # This step is needed to get the size data produced by the compile jobs |
| 314 | + - name: Download sketches reports artifacts |
| 315 | + uses: actions/download-artifact@v4 |
| 316 | + with: |
| 317 | + # All workflow artifacts will be downloaded to this location. |
| 318 | + path: ${{ env.SKETCHES_REPORTS_PATH }} |
| 319 | + |
| 320 | + - uses: arduino/report-size-deltas@v1 |
| 321 | + with: |
| 322 | + sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }} |
0 commit comments