Skip to content

Commit 7d0380a

Browse files
committed
Use private version of workflow
1 parent d7b5dee commit 7d0380a

File tree

1 file changed

+35
-8
lines changed

1 file changed

+35
-8
lines changed

.github/workflows/compile-examples.yml

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
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
22
name: Compile Examples
33

44
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
55
on:
66
push:
77
paths:
8-
- ".github/workflows/compile-examples.ya?ml"
8+
- ".github/workflows/compile-examples-private.ya?ml"
99
- "library.properties"
1010
- "examples/**"
1111
- "src/**"
1212
pull_request:
1313
paths:
14-
- ".github/workflows/compile-examples.ya?ml"
14+
- ".github/workflows/compile-examples-private.ya?ml"
1515
- "library.properties"
1616
- "examples/**"
1717
- "src/**"
@@ -21,14 +21,17 @@ on:
2121
workflow_dispatch:
2222
repository_dispatch:
2323

24+
env:
25+
SKETCHES_REPORTS_PATH: sketches-reports
26+
SKETCHES_REPORTS_ARTIFACT_NAME: sketches-reports
27+
2428
jobs:
2529
build:
2630
name: ${{ matrix.board.fqbn }}
2731
runs-on: ubuntu-latest
28-
permissions: {}
29-
30-
env:
31-
SKETCHES_REPORTS_PATH: sketches-reports
32+
permissions:
33+
contents: read
34+
pull-requests: read
3235

3336
strategy:
3437
fail-fast: false
@@ -67,4 +70,28 @@ jobs:
6770
with:
6871
if-no-files-found: error
6972
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

Comments
 (0)