Fix regression: report size delta size on PR. (#172) #194
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Compile Examples | |
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows | |
on: | |
push: | |
paths: | |
- ".github/workflows/compile-examples.yml" | |
- "examples/**" | |
- "src/**" | |
pull_request: | |
paths: | |
- ".github/workflows/compile-examples.yml" | |
- "examples/**" | |
- "src/**" | |
schedule: | |
# Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms). | |
- cron: "0 8 * * TUE" | |
workflow_dispatch: | |
repository_dispatch: | |
env: | |
# It's convenient to set variables for values used multiple times in the workflow. | |
SKETCHES_REPORTS_PATH: sketches-reports | |
jobs: | |
compile: | |
name: ${{ matrix.board.fqbn }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
board: | |
- fqbn: arduino:samd:mkr1000 | |
platforms: | | |
- name: arduino:samd | |
artifact-name-suffix: arduino-samd-mkr1000 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Compile examples | |
uses: arduino/compile-sketches@v1 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
fqbn: ${{ matrix.board.fqbn }} | |
platforms: ${{ matrix.board.platforms }} | |
libraries: | | |
# Install the library from the local path. | |
- source-path: ./ | |
- name: WiFi101 | |
sketch-paths: | | |
- examples | |
enable-deltas-report: true | |
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }} | |
- name: Save sketches report as workflow artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
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 }} |