-
Notifications
You must be signed in to change notification settings - Fork 7
51 lines (42 loc) · 1.48 KB
/
ci.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
name: build
on: [push, pull_request, workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
env:
BOARD: "Arduino Leonardo" # board name, human-readable
BOARD_PLATFORM: "arduino:avr" # board platform, to be installed by the CLI
BOARD_FQBN: "arduino:avr:leonardo" # fully qualified board name for compilation
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Arduino CLI
uses: arduino/setup-arduino-cli@v1.1.2
- name: Install Board Platform
run: |
arduino-cli core update-index
arduino-cli core install $BOARD_PLATFORM
- name: Add Library Symbolic Link to Repo
run: |
mkdir --parents "$HOME/Arduino/libraries"
ln --symbolic "$PWD" "$HOME/Arduino/libraries/."
- name: Install Dependencies
run: |
git clone https://github.com/MHeironimus/ArduinoJoystickLibrary $HOME/Arduino/libraries/Joystick
- name: Compile Library Examples
run: |
buildSketchPath() {
sktch=${1##*/examples/};
sktch=${sktch%/*.ino};
echo -e "\nBuilding sketch $sktch.ino";
arduino-cli compile --fqbn $BOARD_FQBN "$1";
}
buildExamples() {
IFS=$'\n'; set -f;
for f in $(find $PWD/examples/ -name '*.ino');
do
buildSketchPath $f;
done;
unset IFS; set +f;
}
buildExamples