|
1 | 1 | name: Compile Examples
|
2 | 2 |
|
| 3 | +# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows |
3 | 4 | on:
|
4 | 5 | pull_request:
|
5 | 6 | paths:
|
6 | 7 | - ".github/workflows/compile-examples.yml"
|
| 8 | + - "library.properties" |
7 | 9 | - "examples/**"
|
8 | 10 | - "src/**"
|
9 | 11 | push:
|
10 | 12 | paths:
|
11 | 13 | - ".github/workflows/compile-examples.yml"
|
| 14 | + - "library.properties" |
12 | 15 | - "examples/**"
|
13 | 16 | - "src/**"
|
| 17 | + schedule: |
| 18 | + # Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms). |
| 19 | + - cron: "0 8 * * TUE" |
| 20 | + workflow_dispatch: |
| 21 | + repository_dispatch: |
14 | 22 |
|
15 | 23 | env:
|
16 | 24 | SKETCHES_REPORTS_PATH: sketches-reports
|
17 | 25 | SKETCHES_REPORTS_ARTIFACT_NAME: sketches-reports
|
18 | 26 |
|
19 | 27 | jobs:
|
20 | 28 | compile-test:
|
| 29 | + name: compile for ${{ matrix.fqbn }} |
21 | 30 | runs-on: ubuntu-latest
|
22 | 31 |
|
23 | 32 | env:
|
|
63 | 72 | uses: actions/checkout@v2
|
64 | 73 | with:
|
65 | 74 | repository: arduino/ArduinoCore-API
|
66 |
| - # as specified at https://github.com/arduino/ArduinoCore-mbed/blob/master/README.md#installation |
67 | 75 | path: ${{ env.ARDUINOCORE_API_STAGING_PATH }}
|
68 | 76 |
|
69 | 77 | - name: Install ArduinoCore-API
|
@@ -94,24 +102,29 @@ jobs:
|
94 | 102 | verbose: 'true'
|
95 | 103 |
|
96 | 104 | - name: Save memory usage change report as artifact
|
97 |
| - if: github.event_name == 'pull_request' |
98 | 105 | uses: actions/upload-artifact@v2
|
99 | 106 | with:
|
100 | 107 | name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
|
| 108 | + if-no-files-found: error |
101 | 109 | path: ${{ env.SKETCHES_REPORTS_PATH }}
|
102 | 110 |
|
103 | 111 | report-size-deltas:
|
104 | 112 | needs: compile-test
|
105 |
| - # Only run the job when the workflow is triggered by a pull request from this repository (because arduino/report-size-deltas requires write permissions) |
106 |
| - if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository |
| 113 | + # Run even if some compilations failed. |
| 114 | + if: always() && github.event_name == 'pull_request' |
107 | 115 | runs-on: ubuntu-latest
|
108 | 116 | steps:
|
109 | 117 | - name: Download sketches reports artifact
|
| 118 | + id: download-artifact |
| 119 | + continue-on-error: true # If compilation failed for all boards then there are no artifacts |
110 | 120 | uses: actions/download-artifact@v2
|
111 | 121 | with:
|
112 | 122 | name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
|
113 | 123 | path: ${{ env.SKETCHES_REPORTS_PATH }}
|
114 | 124 |
|
115 |
| - - uses: arduino/report-size-deltas@main |
| 125 | + - name: Comment size deltas report to PR |
| 126 | + uses: arduino/report-size-deltas@v1 |
| 127 | + # If actions/download-artifact failed, there are no artifacts to report from. |
| 128 | + if: steps.download-artifact.outcome == 'success' |
116 | 129 | with:
|
117 | 130 | sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}
|
0 commit comments