-
Notifications
You must be signed in to change notification settings - Fork 80
185 lines (171 loc) · 7.4 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
name: Compile Examples
on:
pull_request:
paths:
- ".github/workflows/compile-examples.yml"
- "examples/**"
- "src/**"
push:
paths:
- ".github/workflows/compile-examples.yml"
- "examples/**"
- "src/**"
jobs:
build:
runs-on: ubuntu-latest
env:
# libraries to install for all boards
UNIVERSAL_LIBRARIES: |
# Install the ArduinoIoTCloud library from the repository
- source-path: ./
- source-url: https://github.com/arduino-libraries/Arduino_ConnectionHandler.git
version: latest
- name: Arduino_DebugUtils
- name: ArduinoMqttClient
# sketch paths to compile (recursive) for all boards
UNIVERSAL_SKETCH_PATHS: '"examples/ArduinoIoTCloud-Advanced" "examples/ArduinoIoTCloud-Basic" "examples/utility/ArduinoIoTCloud_Travis_CI"'
ARDUINOCORE_MBED_STAGING_PATH: extras/ArduinoCore-mbed
ARDUINOCORE_API_STAGING_PATH: extras/ArduinoCore-API
strategy:
fail-fast: false
matrix:
board: [
{"fqbn": "arduino:samd:mkr1000", "type": "wifi"},
{"fqbn": "arduino:samd:mkrwifi1010", "type": "wifi"},
{"fqbn": "arduino:samd:nano_33_iot", "type": "wifi"},
{"fqbn": "arduino:samd:mkrwan1300", "type": "wan"},
{"fqbn": "arduino:samd:mkrgsm1400", "type": "gsm"},
{"fqbn": "arduino:samd:mkrnb1500", "type": "nb"},
{"fqbn": "arduino-beta:mbed:envie_m4", "type": "mbed"},
{"fqbn": "arduino-beta:mbed:envie_m7", "type": "mbed"},
{"fqbn": "esp8266:esp8266:huzzah", "type": "esp8266"}
]
# make board type-specific customizations to the matrix jobs
include:
# WiFi boards
- board:
type: "wifi"
platforms: |
# Install Arduino SAMD Boards via Boards Manager for the toolchain
- name: arduino:samd
# Overwrite the Arduino SAMD Boards release version with version from the tip of the master branch
- source-url: https://github.com/arduino/ArduinoCore-samd/archive/master.zip
name: arduino:samd
libraries: |
- name: ArduinoECCX08
- name: RTCZero
- name: WiFi101
- name: WiFiNINA
- name: Arduino_MKRMEM
sketch-paths: '"examples/utility/Provisioning"'
# LoRaWAN boards
- board:
type: "wan"
platforms: |
- name: arduino:samd
- source-url: https://github.com/arduino/ArduinoCore-samd/archive/master.zip
name: arduino:samd
libraries: |
- name: ArduinoECCX08
- name: RTCZero
- name: MKRWAN
sketch-paths:
# GSM boards
- board:
type: "gsm"
platforms: |
- name: arduino:samd
- source-url: https://github.com/arduino/ArduinoCore-samd/archive/master.zip
name: arduino:samd
libraries: |
- name: ArduinoECCX08
- name: RTCZero
- name: MKRGSM
sketch-paths: '"examples/utility/Provisioning"'
# NB boards
- board:
type: "nb"
platforms: |
- name: arduino:samd
- source-url: https://github.com/arduino/ArduinoCore-samd/archive/master.zip
name: arduino:samd
libraries: |
- name: ArduinoECCX08
- name: RTCZero
- name: MKRNB
sketch-paths: '"examples/utility/Provisioning"'
# Portenta
- board:
type: "mbed"
platforms: |
# Install Arduino mbed-Enabled Boards via Boards Manager for the toolchain
- name: arduino-beta:mbed
# Overwrite the Arduino mbed-Enabled Boards release version with version from the tip of the master branch (located in local path because of the need to first install ArduinoCore-API)
- source-path: extras/ArduinoCore-mbed
name: arduino-beta:mbed
libraries: |
- name: ArduinoECCX08
sketch-paths: '"examples/utility/Provisioning"'
# ESP8266 boards
- board:
type: "esp8266"
platforms: |
# Install ESP8266 platform via Boards Manager
- name: esp8266:esp8266
source-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json
libraries:
sketch-paths:
steps:
- name: Checkout
uses: actions/checkout@v2
# it's necessary to checkout the platform before installing it so that the ArduinoCore-API dependency can be added
- name: Checkout ArduinoCore-mbed
# this step only needed when the Arduino mbed-Enabled Boards platform sourced from the repository is being used
if: matrix.board.type == 'mbed'
uses: actions/checkout@v2
with:
repository: arduino/ArduinoCore-mbed
# the arduino/actions/libraries/compile-examples action will install the platform from this path
path: ${{ env.ARDUINOCORE_MBED_STAGING_PATH }}
- name: Remove ArduinoCore-API symlink from Arduino mbed-Enabled Boards platform
# this step only needed when the Arduino mbed-Enabled Boards platform sourced from the repository is being used
if: matrix.board.type == 'mbed'
run: rm "${{ env.ARDUINOCORE_MBED_STAGING_PATH }}/cores/arduino/api"
- name: Checkout ArduinoCore-API
# this step only needed when the Arduino mbed-Enabled Boards platform sourced from the repository is being used
if: matrix.board.type == 'mbed'
uses: actions/checkout@v2
with:
repository: arduino/ArduinoCore-API
# as specified at https://github.com/arduino/ArduinoCore-mbed/blob/master/README.md#installation
ref: namespace_arduino
path: ${{ env.ARDUINOCORE_API_STAGING_PATH }}
- name: Install ArduinoCore-API
# this step only needed when the Arduino mbed-Enabled Boards platform sourced from the repository is being used
if: matrix.board.type == 'mbed'
run: |
mv "${{ env.ARDUINOCORE_API_STAGING_PATH }}/api" "${{ env.ARDUINOCORE_MBED_STAGING_PATH }}/cores/arduino"
- name: Compile examples
uses: arduino/actions/libraries/compile-examples@master
with:
platforms: ${{ matrix.platforms }}
fqbn: ${{ matrix.board.fqbn }}
libraries: |
${{ env.UNIVERSAL_LIBRARIES }}
${{ matrix.libraries }}
sketch-paths: "${{ env.UNIVERSAL_SKETCH_PATHS }} ${{ matrix.sketch-paths }}"
size-report-sketch: 'ArduinoIoTCloud_Travis_CI'
enable-size-deltas-report: 'true'
- name: Write data to size trends report spreadsheet
# Update report on every push to the master branch
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: arduino/actions/libraries/report-size-trends@master
with:
google-key-file: ${{ secrets.GOOGLE_KEY_FILE }}
spreadsheet-id: 1I6NZkpZpf8KugBkE92adB1Z3_b7ZepOpCdYTOigJpN4
- name: Save memory usage change report as artifact
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v1
with:
name: 'size-deltas-reports'
path: 'size-deltas-reports'