-
Notifications
You must be signed in to change notification settings - Fork 274
99 lines (95 loc) · 3.54 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
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:
name: Build Goil compiler
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
submodules: recursive
- 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 }}
raspberry-pi-examples:
name: Build Raspberry Pi examples
runs-on: ubuntu-22.04
needs: goil
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/armv7/bcm2836/rpi2 --templates=../../../../../../goil/templates/ ${{ matrix.example_name }}.oil
working-directory: examples/cortex-a/armv7/bcm2836/rpi2/${{ matrix.example_name }}
- name: Build the code
run: ./build.py
working-directory: examples/cortex-a/armv7/bcm2836/rpi2/${{ matrix.example_name }}
avr-arduino-uno-examples:
name: Build AVR Arduino Uno examples
runs-on: ubuntu-22.04
needs: goil
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: ./build.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
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: ./build.py
working-directory: examples/avr/arduinoMega2560/${{ matrix.example_name }}