1
+ # Source: https://github.com/per1234/.github/blob/main/workflow-templates/compile-examples-private.md
1
2
name : Compile Examples
2
3
3
- on :
4
+ # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
5
+ on :
4
6
push :
5
- branches : [main]
7
+ paths :
8
+ - " .github/workflows/compile-examples-private.ya?ml"
9
+ - " library.properties"
10
+ - " examples/**"
11
+ - " src/**"
6
12
pull_request :
7
- branches : [main]
8
- # Scheduled trigger checks for breakage caused by changes to external resources (libraries, platforms)
13
+ paths :
14
+ - " .github/workflows/compile-examples-private.ya?ml"
15
+ - " library.properties"
16
+ - " examples/**"
17
+ - " src/**"
9
18
schedule :
10
- # run every Tuesday at 3 AM UTC
11
- - cron : " 0 3 * * 2"
12
- # workflow_dispatch event allows the workflow to be triggered manually
13
- # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch
19
+ # Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms).
20
+ - cron : " 0 8 * * TUE"
14
21
workflow_dispatch :
15
- # repository_dispatch event allows the workflow to be triggered via the GitHub API
16
- # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#repository_dispatch
17
22
repository_dispatch :
18
23
19
24
env :
20
25
SKETCHES_REPORTS_PATH : sketches-reports
21
26
SKETCHES_REPORTS_ARTIFACT_NAME : sketches-reports
22
27
23
28
jobs :
24
- compile-examples :
29
+ build :
30
+ name : ${{ matrix.board.fqbn }}
25
31
runs-on : ubuntu-latest
32
+ permissions :
33
+ contents : read
34
+ pull-requests : read
35
+
36
+ strategy :
37
+ fail-fast : false
38
+
39
+ matrix :
40
+ board :
41
+ - fqbn : arduino:mbed_portenta:envie_m7
42
+ type : arduino:mbed_portenta
43
+ - fqbn : arduino:renesas_portenta:portenta_c33
44
+ type : renesas_portenta
26
45
27
46
steps :
28
47
- name : Checkout repository
29
48
uses : actions/checkout@v3
30
49
31
- - name : Compile example sketches
50
+ - name : Compile examples
32
51
uses : arduino/compile-sketches@v1
33
52
with :
34
- fqbn : arduino:mbed_portenta:envie_m7
35
- platforms : |
36
- - name: arduino:mbed_portenta
53
+ github-token : ${{ secrets.GITHUB_TOKEN }}
54
+ fqbn : ${{ matrix.board.fqbn }}
55
+ platforms : ${{ matrix.board.platforms }}
37
56
libraries : |
57
+ # Install the library from the local path.
38
58
- source-path: ./
39
- - name: Arduino_POSIXStorage
59
+ - name: Arduino_USBHostMbed5
60
+ # Additional library dependencies can be listed here.
61
+ # See: https://github.com/arduino/compile-sketches#libraries
40
62
sketch-paths : |
41
- - examples
63
+ - examples
42
64
enable-deltas-report : true
43
- enable-warnings-report : true
44
65
sketches-report-path : ${{ env.SKETCHES_REPORTS_PATH }}
45
- github-token : ${{ secrets.GITHUB_TOKEN }}
46
66
47
- - name : Save memory usage change report as artifact
67
+ - name : Save sketches report as workflow artifact
48
68
uses : actions/upload-artifact@v3
49
69
with :
50
70
if-no-files-found : error
51
71
path : ${{ env.SKETCHES_REPORTS_PATH }}
52
72
name : ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
73
+
74
+ report-size-deltas :
75
+ needs : build
76
+ # Run even if some compilations failed.
77
+ if : always() && github.event_name == 'pull_request'
78
+ runs-on : ubuntu-latest
79
+ permissions :
80
+ pull-requests : write
81
+
82
+ steps :
83
+ - name : Download sketches reports artifact
84
+ id : download-artifact
85
+ continue-on-error : true # If compilation failed for all boards then there are no artifacts
86
+ uses : actions/download-artifact@v3
87
+ with :
88
+ name : ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
89
+ path : ${{ env.SKETCHES_REPORTS_PATH }}
90
+
91
+ - name : Comment size deltas report to PR
92
+ uses : arduino/report-size-deltas@v1
93
+ # If actions/download-artifact failed, there are no artifacts to report from.
94
+ if : steps.download-artifact.outcome == 'success'
95
+ with :
96
+ sketches-reports-source : ${{ env.SKETCHES_REPORTS_PATH }}
0 commit comments