-
-
Notifications
You must be signed in to change notification settings - Fork 26
94 lines (84 loc) · 3.83 KB
/
examples.yaml
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
# https://github.com/arduino/arduino-cli-example/blob/master/.github/workflows/test.yaml
# This is the name of the workflow, visible on GitHub UI.
name: Build Examples
# Here we tell GitHub to run the workflow when a commit
# is pushed or a Pull Request is opened.
on: [push, pull_request]
# This is the list of jobs that will be run concurrently.
# Since we use a build matrix, the actual number of jobs
# started depends on how many configurations the matrix
# will produce.
jobs:
# This is the name of the job - can be whatever.
examples-matrix:
# Here we tell GitHub that the jobs must be determined
# dynamically depending on a matrix configuration.
strategy:
matrix:
# The matrix will produce one job for each configuration
# parameter of type `board`, in this case a
# total of 3.
board:
- teensy41
- teensy40
- stm32f4
flags:
- "-DQNETHERNET_ENABLE_RAW_FRAME_SUPPORT=1 -DQNETHERNET_DRIVER_W5500"
- "-DQNETHERNET_ENABLE_RAW_FRAME_SUPPORT=1"
# This is usually optional but we need to statically define the
# FQBN of the boards we want to test for each platform. In the
# future the CLI might automatically detect and download the core
# needed to compile against a certain FQBN, at that point the
# following `include` section will be useless.
include:
# This works like this: when the board is "arduino:samd", the
# variable `fqbn` is set to "arduino:samd:nano_33_iot".
- board: teensy41
platform: teensy:avr
fqbn: teensy:avr:teensy41
url: https://www.pjrc.com/teensy/package_teensy_index.json
- board: teensy40
platform: teensy:avr
fqbn: teensy:avr:teensy41
url: https://www.pjrc.com/teensy/package_teensy_index.json
- board: stm32f4
platform: STMicroelectronics:stm32
fqbn: STMicroelectronics:stm32:GenF4
url: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
# This is the platform GitHub will use to run our workflow, we
# pick Windows for no particular reason.
runs-on: ubuntu-latest
# This is the list of steps this job will run.
steps:
# First of all, we clone the repo using the `checkout` action.
- name: Checkout
uses: actions/checkout@v4
# We use the `arduino/setup-arduino-cli` action to install and
# configure the Arduino CLI on the system.
- name: Setup Arduino CLI
uses: arduino/setup-arduino-cli@v2
# We then install the platform, which one will be determined
# dynamically by the build matrix.
- name: Install Platform
run: |
arduino-cli --additional-urls ${{ matrix.url }} core update-index
arduino-cli --additional-urls ${{ matrix.url }} core install ${{ matrix.platform }}
# Finally, we compile the sketch, using the FQBN that was set
# in the build matrix.
- name: Compile Examples
run: |
for example in examples/*; do
if [[ "${{ matrix.fqbn }}" =~ ^teensy: ]]; then
all_flags="$(arduino-cli compile --fqbn ${{ matrix.fqbn }} ${example} --show-properties |grep build.flags.defs) ${{ matrix.flags }}"
arduino-cli compile \
--warnings all \
--build-property "${all_flags}" \
--fqbn ${{ matrix.fqbn }} ${example} #&> /dev/null
else
arduino-cli compile \
--warnings all \
--build-property compiler.cpp.extra_flags="${{ matrix.flags }}" \
--build-property compiler.c.extra_flags="${{ matrix.flags }}" \
--fqbn ${{ matrix.fqbn }} ${example} #&> /dev/null
fi
done