1
- # Source: https://github.com/per1234/.github/blob/main/workflow-templates/compile-examples.md
1
+ # Source: https://github.com/per1234/.github/blob/main/workflow-templates/compile-examples-private .md
2
2
name : Compile Examples
3
3
4
4
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
5
5
on :
6
6
push :
7
7
paths :
8
- - " .github/workflows/compile-examples.ya?ml"
8
+ - " .github/workflows/compile-examples-private .ya?ml"
9
9
- " library.properties"
10
10
- " examples/**"
11
11
- " src/**"
12
12
pull_request :
13
13
paths :
14
- - " .github/workflows/compile-examples.ya?ml"
14
+ - " .github/workflows/compile-examples-private .ya?ml"
15
15
- " library.properties"
16
16
- " examples/**"
17
17
- " src/**"
21
21
workflow_dispatch :
22
22
repository_dispatch :
23
23
24
+ env :
25
+ SKETCHES_REPORTS_PATH : sketches-reports
26
+ SKETCHES_REPORTS_ARTIFACT_NAME : sketches-reports
27
+
24
28
jobs :
25
29
build :
26
30
name : ${{ matrix.board.fqbn }}
27
31
runs-on : ubuntu-latest
28
- permissions : {}
29
-
30
- env :
31
- SKETCHES_REPORTS_PATH : sketches-reports
32
+ permissions :
33
+ contents : read
34
+ pull-requests : read
32
35
33
36
strategy :
34
37
fail-fast : false
67
70
with :
68
71
if-no-files-found : error
69
72
path : ${{ env.SKETCHES_REPORTS_PATH }}
70
- name : ${{ env.SKETCHES_REPORTS_PATH }}
73
+ name : ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
74
+
75
+ report-size-deltas :
76
+ needs : build
77
+ # Run even if some compilations failed.
78
+ if : always() && github.event_name == 'pull_request'
79
+ runs-on : ubuntu-latest
80
+ permissions :
81
+ pull-requests : write
82
+
83
+ steps :
84
+ - name : Download sketches reports artifact
85
+ id : download-artifact
86
+ continue-on-error : true # If compilation failed for all boards then there are no artifacts
87
+ uses : actions/download-artifact@v3
88
+ with :
89
+ name : ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
90
+ path : ${{ env.SKETCHES_REPORTS_PATH }}
91
+
92
+ - name : Comment size deltas report to PR
93
+ uses : arduino/report-size-deltas@v1
94
+ # If actions/download-artifact failed, there are no artifacts to report from.
95
+ if : steps.download-artifact.outcome == 'success'
96
+ with :
97
+ sketches-reports-source : ${{ env.SKETCHES_REPORTS_PATH }}
0 commit comments