-
Notifications
You must be signed in to change notification settings - Fork 274
370 lines (355 loc) · 14 KB
/
build-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
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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
name: Build compiler and examples
on: [push, pull_request]
env:
# Create a new and unique cache for each run, otherwise the cache from the previous actions would be used
CACHE_KEY: repo-${{ github.run_id }}
GOIL: ${{ github.workspace }}/goil/makefile-unix/goil
jobs:
goil-linux:
name: Build Goil compiler for Linux
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Build Goil
run: ./build.py
working-directory: goil/makefile-unix
- name: Cache Goil build
# Cache the source and build files to share them later with other jobs
uses: actions/cache/save@v3
with:
path: ${{ github.workspace }}
key: ${{ env.CACHE_KEY }}
goil-cygwin:
name: Build Goil compiler for Cygwin
runs-on: windows-latest
steps:
- name: Install Cygwin
uses: egor-tensin/setup-cygwin@v4
with:
packages: gcc-g++ python
- name: Checkout sources
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Build Goil
shell: C:\tools\cygwin\bin\bash.exe --login -o igncr '{0}'
# Do not use "working-directory:" because it would involve using the github.workspace variable, which is a Windows path incompatible with Bash
run: |
cd $GITHUB_WORKSPACE/goil/makefile-unix
python build.py
raspberry-pi-examples:
name: Build Raspberry Pi examples
runs-on: ubuntu-22.04
needs: goil-linux
strategy:
matrix:
# List only the examples that currently compile
example_name: [blink]
steps:
- name: Install ARM toolchain
run: |
sudo apt update
sudo apt install -y gcc-arm-none-eabi
- name: Retrieve sources and Goil binary
uses: actions/cache/restore@v3
with:
path: ${{ github.workspace }}
key: ${{ env.CACHE_KEY }}
- name: Generate the code
run: ${{ env.GOIL }} --target=cortex-a-r/armv7/bcm2836/rpi2 --templates=../../../../../../goil/templates/ ${{ matrix.example_name }}.oil
working-directory: examples/cortex-a-r/armv7/bcm2836/rpi2/${{ matrix.example_name }}
- name: Build the code
run: ./make.py
working-directory: examples/cortex-a-r/armv7/bcm2836/rpi2/${{ matrix.example_name }}
cortex-a-r-spider-examples:
name: Build Renesas Spider Cortex-R52 examples
runs-on: ubuntu-22.04
needs: goil-linux
env:
ARM_TOOLCHAIN_NAME: arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi
strategy:
matrix:
example_name: [blink, can_demo, iccom, one_task]
steps:
# A toolchain newer than the one included in Ubuntu 22.04 is needed
- name: Install ARM toolchain
run: |
wget https://developer.arm.com/-/media/Files/downloads/gnu/12.2.rel1/binrel/${{ env.ARM_TOOLCHAIN_NAME }}.tar.xz
sudo tar -xf ${{ env.ARM_TOOLCHAIN_NAME }}.tar.xz -C /opt
- name: Retrieve sources and Goil binary
uses: actions/cache/restore@v3
with:
path: ${{ github.workspace }}
key: ${{ env.CACHE_KEY }}
- name: Generate the code
run: |
echo "$(realpath /opt/${{ env.ARM_TOOLCHAIN_NAME }}/bin)" >> $GITHUB_PATH
${{ env.GOIL }} --target=cortex-a-r/armv8/spider --templates=../../../../../goil/templates/ ${{ matrix.example_name }}.oil
working-directory: examples/cortex-a-r/armv8/spider/${{ matrix.example_name }}
- name: Build the code
run: |
echo "$(realpath /opt/${{ env.ARM_TOOLCHAIN_NAME }}/bin)" >> $GITHUB_PATH
./make.py
working-directory: examples/cortex-a-r/armv8/spider/${{ matrix.example_name }}
avr-arduino-uno-examples:
name: Build AVR Arduino Uno examples
runs-on: ubuntu-22.04
needs: goil-linux
strategy:
matrix:
example_name: [blink, customCounterExample, extInterrupt, serial, trace]
steps:
- name: Install AVR toolchain
run: |
sudo apt update
sudo apt install -y avr-libc gcc-avr
- name: Retrieve sources and Goil binary
uses: actions/cache/restore@v3
with:
path: ${{ github.workspace }}
key: ${{ env.CACHE_KEY }}
- name: Generate the code
# Use a wildcard to find the .oil file because it is not always named the same than the directory is it contained by
run: ${{ env.GOIL }} --target=avr/arduino/uno --templates=../../../../goil/templates/ *.oil
working-directory: examples/avr/arduinoUno/${{ matrix.example_name }}
- name: Build the code
run: ./make.py
working-directory: examples/avr/arduinoUno/${{ matrix.example_name }}
avr-arduino-mega-2560-examples:
name: Build AVR Arduino Mega 2560 examples
runs-on: ubuntu-22.04
needs: goil-linux
strategy:
matrix:
example_name: [blink, extInterrupt, serial]
steps:
- name: Install AVR toolchain
run: |
sudo apt update
sudo apt install -y avr-libc gcc-avr
- name: Retrieve sources and Goil binary
uses: actions/cache/restore@v3
with:
path: ${{ github.workspace }}
key: ${{ env.CACHE_KEY }}
- name: Generate the code
run: ${{ env.GOIL }} --target=avr/arduino/mega --templates=../../../../goil/templates/ ${{ matrix.example_name }}.oil
working-directory: examples/avr/arduinoMega2560/${{ matrix.example_name }}
- name: Build the code
run: ./make.py
working-directory: examples/avr/arduinoMega2560/${{ matrix.example_name }}
posix-examples:
name: Build POSIX examples
runs-on: ubuntu-22.04
needs: goil-linux
strategy:
matrix:
example_name: [can_demo, events, ioc, isr, messages, one_task, periodic, trace_test]
steps:
- name: Retrieve sources and Goil binary
uses: actions/cache/restore@v3
with:
path: ${{ github.workspace }}
key: ${{ env.CACHE_KEY }}
- name: Generate the code
run: ${{ env.GOIL }} --target=posix/linux --templates=../../../goil/templates/ ${{ matrix.example_name }}.oil
working-directory: examples/posix/${{ matrix.example_name }}
- name: Build the code
run: ./make.py
working-directory: examples/posix/${{ matrix.example_name }}
cortex-m-arduino-m0-examples:
name: Build Cortex-M Arduino M0 examples
runs-on: ubuntu-22.04
needs: goil-linux
strategy:
matrix:
example_name: [blink]
steps:
- name: Install ARM toolchain
run: |
sudo apt update
sudo apt install -y gcc-arm-none-eabi
- name: Retrieve sources and Goil binary
uses: actions/cache/restore@v3
with:
path: ${{ github.workspace }}
key: ${{ env.CACHE_KEY }}
- name: Generate the code
run: ${{ env.GOIL }} --target=cortex-m/armv6m/samd21/ArduinoM0 --templates=../../../../../../goil/templates/ ${{ matrix.example_name }}.oil
working-directory: examples/cortex-m/armv6m/samd21/ArduinoM0/${{ matrix.example_name }}
- name: Build the code
run: ./make.py
working-directory: examples/cortex-m/armv6m/samd21/ArduinoM0/${{ matrix.example_name }}
cortex-m-xplained-pro-examples:
name: Build Cortex-M Xplained Pro examples
runs-on: ubuntu-22.04
needs: goil-linux
strategy:
matrix:
example_name: [blink, readbutton, readbutton_isr]
steps:
- name: Install ARM toolchain
run: |
sudo apt update
sudo apt install -y gcc-arm-none-eabi
- name: Retrieve sources and Goil binary
uses: actions/cache/restore@v3
with:
path: ${{ github.workspace }}
key: ${{ env.CACHE_KEY }}
- name: Generate the code
run: ${{ env.GOIL }} --target=cortex-m/armv6m/samd21/XPlainedPro --templates=../../../../../../goil/templates/ ${{ matrix.example_name }}.oil
working-directory: examples/cortex-m/armv6m/samd21/XPlainedPro/${{ matrix.example_name }}
- name: Build the code
run: ./make.py
working-directory: examples/cortex-m/armv6m/samd21/XPlainedPro/${{ matrix.example_name }}
cortex-m-arduino-due-examples:
name: Build Cortex-M Arduino Due examples
runs-on: ubuntu-22.04
needs: goil-linux
strategy:
matrix:
example_name: [blink]
steps:
- name: Install ARM toolchain
run: |
sudo apt update
sudo apt install -y gcc-arm-none-eabi
- name: Retrieve sources and Goil binary
uses: actions/cache/restore@v3
with:
path: ${{ github.workspace }}
key: ${{ env.CACHE_KEY }}
- name: Generate the code
run: ${{ env.GOIL }} --target=cortex-m/armv7m/atsam3x8e/arduino_due --templates=../../../../../../goil/templates/ ${{ matrix.example_name }}.oil
working-directory: examples/cortex-m/armv7m/atsam3x8e/arduino_due/${{ matrix.example_name }}
- name: Build the code
run: ./make.py
working-directory: examples/cortex-m/armv7m/atsam3x8e/arduino_due/${{ matrix.example_name }}
cortex-m-smart-fusion-2-examples:
name: Build Cortex-M SmartFusion2 examples
runs-on: ubuntu-22.04
needs: goil-linux
strategy:
matrix:
example_name: [blink, blinkAndFPGA]
steps:
- name: Install ARM toolchain
run: |
sudo apt update
sudo apt install -y gcc-arm-none-eabi
- name: Retrieve sources and Goil binary
uses: actions/cache/restore@v3
with:
path: ${{ github.workspace }}
key: ${{ env.CACHE_KEY }}
- name: Generate the code
run: ${{ env.GOIL }} --target=cortex-m/armv7m/SmartFusion2 --templates=../../../../../../goil/templates/ ${{ matrix.example_name }}.oil
working-directory: examples/cortex-m/armv7m/SmartFusion2/starterKit/${{ matrix.example_name }}
- name: Build the code
run: ./make.py
working-directory: examples/cortex-m/armv7m/SmartFusion2/starterKit/${{ matrix.example_name }}
cortex-m-corolab-f303-examples:
name: Build Cortex-M coroLab-F303 examples
runs-on: ubuntu-22.04
needs: goil-linux
strategy:
matrix:
example_name: [base, baseCMake, trace]
steps:
- name: Install ARM toolchain
run: |
sudo apt update
sudo apt install -y gcc-arm-none-eabi
- name: Retrieve sources and Goil binary
uses: actions/cache/restore@v3
with:
path: ${{ github.workspace }}
key: ${{ env.CACHE_KEY }}
- name: Generate the code
run: ${{ env.GOIL }} --target=cortex-m/armv7em/stm32f303/coroLabBoard --templates=../../../../../../goil/templates/ ${{ matrix.example_name }}.oil
working-directory: examples/cortex-m/armv7em/stm32f303/coroLab/${{ matrix.example_name }}
- name: Build the code
run: |
if [ -e CMakeLists.txt ]
then
cmake .
make -j $(nproc)
else
./make.py
fi
working-directory: examples/cortex-m/armv7em/stm32f303/coroLab/${{ matrix.example_name }}
cortex-m-smart-nucleo-f303-examples:
name: Build Cortex-M Nucleo-F303 examples
runs-on: ubuntu-22.04
needs: goil-linux
strategy:
matrix:
example_name: [blink, readbutton_isr, serial, trace]
steps:
- name: Install ARM toolchain
run: |
sudo apt update
sudo apt install -y gcc-arm-none-eabi
- name: Retrieve sources and Goil binary
uses: actions/cache/restore@v3
with:
path: ${{ github.workspace }}
key: ${{ env.CACHE_KEY }}
- name: Generate the code
run: ${{ env.GOIL }} --target=cortex-m/armv7em/stm32f303 --templates=../../../../../../goil/templates/ ${{ matrix.example_name }}.oil
working-directory: examples/cortex-m/armv7em/stm32f303/Nucleo-32/${{ matrix.example_name }}
- name: Build the code
run: ./make.py
working-directory: examples/cortex-m/armv7em/stm32f303/Nucleo-32/${{ matrix.example_name }}
cortex-m-smart-nucleo-l432-examples:
name: Build Cortex-M Nucleo-F432 examples
runs-on: ubuntu-22.04
needs: goil-linux
strategy:
matrix:
example_name: [blink, readbutton, readbutton_isr, serial, trace]
steps:
- name: Install ARM toolchain
run: |
sudo apt update
sudo apt install -y gcc-arm-none-eabi
- name: Retrieve sources and Goil binary
uses: actions/cache/restore@v3
with:
path: ${{ github.workspace }}
key: ${{ env.CACHE_KEY }}
- name: Generate the code
run: ${{ env.GOIL }} --target=cortex-m/armv7em/stm32l432 --templates=../../../../../../goil/templates/ ${{ matrix.example_name }}.oil
working-directory: examples/cortex-m/armv7em/stm32l432/Nucleo-32/${{ matrix.example_name }}
- name: Build the code
run: ./make.py
working-directory: examples/cortex-m/armv7em/stm32l432/Nucleo-32/${{ matrix.example_name }}
cortex-m-smart-stm32f4discovery-examples:
name: Build Cortex-M STM32F4DISCOVERY examples
runs-on: ubuntu-22.04
needs: goil-linux
strategy:
matrix:
example_name: [alarms, blink, readbutton, readbutton_isr, readbutton_isr1, testDisableEnable, timer]
steps:
- name: Install ARM toolchain
run: |
sudo apt update
sudo apt install -y gcc-arm-none-eabi
- name: Retrieve sources and Goil binary
uses: actions/cache/restore@v3
with:
path: ${{ github.workspace }}
key: ${{ env.CACHE_KEY }}
- name: Generate the code
run: ${{ env.GOIL }} --target=cortex-m/armv7em/stm32f407/stm32f4discovery --templates=../../../../../../goil/templates/ ${{ matrix.example_name }}.oil
working-directory: examples/cortex-m/armv7em/stm32f407/stm32f4discovery/${{ matrix.example_name }}
- name: Build the code
run: ./make.py
working-directory: examples/cortex-m/armv7em/stm32f407/stm32f4discovery/${{ matrix.example_name }}