-
Notifications
You must be signed in to change notification settings - Fork 141
95 lines (81 loc) · 4.16 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
95
name: Examples
on: push
jobs:
compile-examples:
name: Examples
runs-on: ubuntu-20.04
strategy:
matrix:
board: [AVR, Nano 33 BLE, Pi Pico, Pi Pico W, Nano 33 IoT, UNO R4, ESP32, ESP32-S3, ESP8266, AVR USB, Mega, Leonardo, Due, Nano Every, Teensy 3.x, Teensy 4.1]
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Cache Arduino CLI
uses: actions/cache@v3
with:
path: |
~/.local/bin
key: ${{ runner.os }}-local-bin-v2
- name: Cache Arduino Cores and Libraries
uses: actions/cache@v3
with:
path: |
~/.arduino15
~/Arduino/libraries
key: ${{ runner.os }}-arduino-v3-${{ github.sha }}
restore-keys: ${{ runner.os }}-arduino-v3-
- name: Cache Compiled Arduino Cores and Sketches
uses: actions/cache@v3
with:
path: |
/tmp/arduino-sketch-*
/tmp/core-*
key: ${{ runner.os }}-arduino-compiled-v3-${{ matrix.board }}-${{ github.sha }}
restore-keys: ${{ runner.os }}-arduino-compiled-v3-${{ matrix.board }}-
- name: Update $PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install Arduino CLI
run: |
mkdir -p "$HOME/.local/bin"
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR="$HOME/.local/bin" sh
mkdir -p "$HOME/.arduino15"
cp "$GITHUB_WORKSPACE/tools/arduino-cli.yaml" "$HOME/.arduino15"
arduino-cli core update-index
- name: Install Arduino Boards
run: |
arduino-cli core install arduino:avr arduino:mbed_nano arduino:mbed_rp2040 arduino:samd esp32:esp32 esp8266:esp8266 arduino:sam arduino:megaavr arduino:renesas_uno teensy:avr rp2040:rp2040
arduino-cli core upgrade
arduino-cli cache clean
version=$(arduino-cli core list | grep 'teensy:avr' | awk '{print $2}') && { sed -i 's/^recipe.hooks.postbuild/# recipe.hooks.postbuild/g' $HOME/.arduino15/packages/teensy/hardware/avr/$version/platform.txt ||:; }
- name: Install Arduino Libraries
run: |
mkdir -p "$HOME/Arduino/libraries" && cd "$_"
[ -d Adafruit-GFX-Library ] || git clone https://github.com/adafruit/Adafruit-GFX-Library.git --depth=1 &
[ -d Adafruit_SSD1306 ] || git clone https://github.com/adafruit/Adafruit_SSD1306.git --depth=1 &
[ -d Adafruit_BusIO ] || git clone https://github.com/adafruit/Adafruit_BusIO.git --depth=1 &
[ -d FastLED ] || git clone https://github.com/FastLED/FastLED.git --depth=1 &
[ -d MIDIUSB ] || git clone https://github.com/arduino-libraries/MIDIUSB.git --depth=1 &
[ -d Audio ] || git clone https://github.com/PaulStoffregen/Audio.git --depth=1 &
[ -d ArduinoBLE ] || git clone https://github.com/arduino-libraries/ArduinoBLE.git --depth=1 &
[ -d Arduino-AppleMIDI-Library ] || git clone https://github.com/lathoub/Arduino-AppleMIDI-Library.git --depth=1 --branch v3.2.0 &
[ -d arduino_midi_library ] || git clone https://github.com/FortySevenEffects/arduino_midi_library.git --depth=1 &
ln -snf "$GITHUB_WORKSPACE" "$HOME/Arduino/libraries/"
cp "$GITHUB_WORKSPACE/examples/3. MIDI Interfaces/AppleMIDI/WiFi-Credentials.example.h" "$GITHUB_WORKSPACE/examples/3. MIDI Interfaces/AppleMIDI/WiFi-Credentials.h"
- name: Cache Python Packages
uses: actions/cache@v3
with:
path: ~/.venv
key: ${{ runner.os }}-python-venv-v2-${{ github.sha }}
restore-keys: ${{ runner.os }}-python-venv-v2-
- name: Install Python Packages
run: |
[ -d "$HOME/.venv" ] || python3 -m venv "$HOME/.venv"
source "$HOME/.venv/bin/activate"
python3 -m pip install -U pyyaml pyserial
- name: Compile Examples
run: |
source "$HOME/.venv/bin/activate"
python3 "$GITHUB_WORKSPACE/tools/arduino-example-builder.py" "${{ matrix.board }}" --examples_dir "$GITHUB_WORKSPACE/examples"