-
-
Notifications
You must be signed in to change notification settings - Fork 42
229 lines (219 loc) · 7.85 KB
/
compile-examples.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# This workflow compiles the example sketches for one of each distinct type of active official Arduino board.
#
# This requires the use of external components (e.g., libraries, boards platform, toolchain), so it is possible for
# compilations to be broken by bugs in the external components, even though the example itself is perfect.
#
# If this happens, the procedure is:
# - Report the bug to the appropriate issue tracker.
# - Adjust this workflow to remove the compilation for the specific board/sketch combination that is failing due to the
# bug.
# - Add a comment to the workflow providing the URL of the issue report.
# - Once the bug is fixed and the fix released, revert the commit that removed the failing compilation.
# - If the issue is closed as "wontfix", add a comment to the affected examples documenting the incompatibility and open
# an issue requesting that the associated tutorials be updated.
name: Compile Examples
on:
pull_request:
paths-ignore:
- "**"
- "!.github/workflows/compile-examples.ya?ml"
- "!examples/**"
- "**.adoc"
- "**.jpg"
- "**.md"
- "**.png"
- "**.txt"
push:
paths-ignore:
- "**"
- "!.github/workflows/compile-examples.ya?ml"
- "!examples/**"
- "**.adoc"
- "**.jpg"
- "**.md"
- "**.png"
- "**.txt"
# Scheduled trigger checks for breakage caused by changes to external resources (libraries, platforms)
schedule:
# run every Tuesday at 3 AM UTC
- cron: "0 3 * * 2"
# workflow_dispatch event allows the workflow to be triggered manually
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch
workflow_dispatch:
# repository_dispatch event allows the workflow to be triggered via the GitHub API
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#repository_dispatch
repository_dispatch:
jobs:
build:
name: ${{ matrix.board.fqbn }}
runs-on: ubuntu-latest
env:
# Libraries to install for all boards
UNIVERSAL_LIBRARIES: |
- name: Servo
- name: LiquidCrystal
- name: CapacitiveSensor
# Sketch paths to compile (recursive) for all boards
UNIVERSAL_SKETCH_PATHS: |
- examples/01.Basics
- examples/02.Digital/BlinkWithoutDelay
- examples/02.Digital/Button
- examples/02.Digital/Debounce
- examples/02.Digital/DigitalInputPullup
- examples/02.Digital/StateChangeDetection
- examples/03.Analog
- examples/04.Communication/ASCIITable
- examples/04.Communication/Dimmer
- examples/04.Communication/Graph
- examples/04.Communication/Midi
- examples/04.Communication/PhysicalPixel
- examples/04.Communication/ReadASCIIString
- examples/04.Communication/SerialCallResponse
- examples/04.Communication/SerialCallResponseASCII
- examples/04.Communication/SerialEvent
- examples/04.Communication/VirtualColorMixer
- examples/05.Control
- examples/06.Sensors
- examples/07.Display
- examples/08.Strings/CharacterAnalysis
- examples/08.Strings/StringAdditionOperator
- examples/08.Strings/StringAppendOperator
- examples/08.Strings/StringCaseChanges
- examples/08.Strings/StringCharacters
- examples/08.Strings/StringConstructors
- examples/08.Strings/StringIndexOf
- examples/08.Strings/StringLength
- examples/08.Strings/StringLengthTrim
- examples/08.Strings/StringReplace
- examples/08.Strings/StringStartsWithEndsWith
- examples/08.Strings/StringSubstring
- examples/08.Strings/StringToInt
- examples/11.ArduinoISP
strategy:
fail-fast: false
matrix:
board:
# For testing the Starter Kit examples
- fqbn: arduino:avr:uno
usb: false
serial1: false
starter-kit: true
tone: true
a5: true
# Adding this in addition to the Uno because it has 1.5 kB less available flash
- fqbn: arduino:avr:nano
usb: false
serial1: false
starter-kit: false
tone: true
a5: true
- fqbn: arduino:avr:leonardo
usb: true
serial1: true
starter-kit: false
tone: true
a5: true
- fqbn: arduino:megaavr:uno2018:mode=off
usb: false
serial1: true
starter-kit: false
tone: true
a5: true
- fqbn: arduino:samd:mkrzero
usb: true
serial1: true
starter-kit: false
tone: true
a5: true
- fqbn: arduino:mbed_nano:nano33ble
usb: false
serial1: true
starter-kit: false
tone: true
a5: true
- fqbn: arduino:mbed_nano:nanorp2040connect
usb: false
serial1: true
starter-kit: false
tone: true
# WiFiNINA library is required to use pins A4-A7.
a5: false
- fqbn: arduino:mbed_portenta:envie_m7
usb: false
serial1: true
starter-kit: false
tone: true
a5: true
- fqbn: arduino:sam:arduino_due_x
usb: true
serial1: true
starter-kit: false
# Bug report: https://github.com/arduino/ArduinoCore-sam/issues/24
# Change the value to true once it is fixed.
tone: false
a5: true
# Make board type-specific customizations to the matrix jobs
include:
- board:
# Boards with Keyboard+Mouse library compatibility
usb: true
# Install these libraries in addition to the ones defined by env.UNIVERSAL_LIBRARIES
usb-libraries: |
- name: Keyboard
- name: Mouse
# Compile these sketches in addition to the ones defined by env.UNIVERSAL_SKETCH_PATHS
usb-sketch-paths: |
- examples/09.USB
- board:
usb: false
usb-libraries: ""
usb-sketch-paths: ""
- board:
# Boards with a Serial1 port
serial1: true
serial1-sketch-paths: |
- examples/04.Communication/MultiSerial
- examples/04.Communication/SerialPassthrough
- board:
serial1: false
serial1-sketch-paths: ""
- board:
starter-kit: true
starter-kit-sketch-paths: |
- examples/10.StarterKit_BasicKit
- board:
starter-kit: false
starter-kit-sketch-paths: ""
- board:
tone: true
tone-sketch-paths: |
- examples/02.Digital/toneKeyboard
- examples/02.Digital/toneMelody
- examples/02.Digital/toneMultiple
- examples/02.Digital/tonePitchFollower
- board:
tone: false
tone-sketch-paths: ""
- board:
a5: true
a5-sketch-paths: |
- examples/08.Strings/StringComparisonOperators
- board:
a5: false
tone-sketch-paths: ""
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Compile examples
uses: arduino/compile-sketches@v1
with:
fqbn: ${{ matrix.board.fqbn }}
libraries: |
${{ env.UNIVERSAL_LIBRARIES }}
${{ matrix.usb-libraries }}
sketch-paths: |
${{ env.UNIVERSAL_SKETCH_PATHS }}
${{ matrix.usb-sketch-paths }}
${{ matrix.serial1-sketch-paths }}
${{ matrix.starter-kit-sketch-paths }}
${{ matrix.tone-sketch-paths }}