|
1 | 1 | name: Compile Examples
|
2 | 2 |
|
| 3 | +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows |
3 | 4 | on:
|
4 |
| - - push |
5 |
| - - pull_request |
6 |
| - |
7 |
| -env: |
8 |
| - # It's convenient to set variables for values used multiple times in the workflow. |
9 |
| - SKETCHES_REPORTS_PATH: sketches-reports |
| 5 | + push: |
| 6 | + paths: |
| 7 | + - ".github/workflows/compile-examples.yml" |
| 8 | + - "examples/**" |
| 9 | + - "src/**" |
| 10 | + pull_request: |
| 11 | + paths: |
| 12 | + - ".github/workflows/compile-examples.yml" |
| 13 | + - "examples/**" |
| 14 | + - "src/**" |
| 15 | + schedule: |
| 16 | + # Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms). |
| 17 | + - cron: "0 8 * * TUE" |
| 18 | + workflow_dispatch: |
| 19 | + repository_dispatch: |
10 | 20 |
|
11 | 21 | jobs:
|
12 |
| - compile: |
| 22 | + build: |
| 23 | + name: ${{ matrix.board.fqbn }} |
13 | 24 | runs-on: ubuntu-latest
|
14 | 25 |
|
| 26 | + env: |
| 27 | + SKETCHES_REPORTS_PATH: sketches-reports |
| 28 | + |
15 | 29 | strategy:
|
| 30 | + fail-fast: false |
| 31 | + |
16 | 32 | matrix:
|
17 | 33 | board:
|
18 | 34 | - fqbn: arduino:mbed_opta:opta
|
19 | 35 | artifact-name-suffix: arduino-mbed_opta-opta
|
20 | 36 |
|
21 | 37 | steps:
|
22 |
| - - uses: actions/checkout@v4 |
| 38 | + - name: Checkout repository |
| 39 | + uses: actions/checkout@v4 |
23 | 40 |
|
24 |
| - - uses: arduino/compile-sketches@v1 |
| 41 | + - name: Compile examples |
| 42 | + uses: arduino/compile-sketches@v1 |
25 | 43 | with:
|
26 | 44 | fqbn: ${{ matrix.board.fqbn }}
|
27 | 45 | platforms: ${{ matrix.board.platforms }}
|
28 | 46 | libraries: |
|
| 47 | + # Install the library from the local path. |
29 | 48 | - source-path: ./
|
30 | 49 | - name: Arduino_Opta_Blueprint
|
31 | 50 | - name: Arduino_SerialUpdater
|
32 | 51 | - name: Arduino_DebugUtils
|
33 | 52 | - name: ArduinoRS485
|
34 | 53 | - name: ArduinoModbus
|
| 54 | + sketch-paths: | |
| 55 | + - examples |
35 | 56 | enable-deltas-report: true
|
36 | 57 | github-token: ${{ secrets.GITHUB_TOKEN }}
|
37 | 58 | sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
|
38 | 59 | cli-compile-flags: |
|
39 | 60 | - --build-property
|
40 | 61 | - compiler.cpp.extra_flags=-DUSE_MODBUS_SENSOR_MD02=1
|
41 | 62 |
|
42 |
| - # This step is needed to pass the size data to the report job. |
43 |
| - - name: Upload sketches report to workflow artifact |
| 63 | + - name: Save sketches report as workflow artifact |
44 | 64 | uses: actions/upload-artifact@v4
|
45 | 65 | with:
|
46 |
| - name: sketches-reports-${{ matrix.board.artifact-name-suffix }} |
| 66 | + if-no-files-found: error |
47 | 67 | path: ${{ env.SKETCHES_REPORTS_PATH }}
|
48 |
| - |
49 |
| - # When using a matrix to compile for multiple boards, it's necessary to use a separate job for the deltas report |
50 |
| - report: |
51 |
| - needs: compile # Wait for the compile job to finish to get the data for the report |
52 |
| - if: github.event_name == 'pull_request' # Only run the job when the workflow is triggered by a pull request |
53 |
| - runs-on: ubuntu-latest |
54 |
| - |
55 |
| - steps: |
56 |
| - # This step is needed to get the size data produced by the compile jobs |
57 |
| - - name: Download sketches reports artifacts |
58 |
| - uses: actions/download-artifact@v4 |
59 |
| - with: |
60 |
| - # All workflow artifacts will be downloaded to this location. |
61 |
| - path: ${{ env.SKETCHES_REPORTS_PATH }} |
62 |
| - |
63 |
| - - uses: arduino/report-size-deltas@v1 |
64 |
| - with: |
65 |
| - sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }} |
| 68 | + name: sketches-report-${{ matrix.board.artifact-name-suffix }} |
0 commit comments