-
Notifications
You must be signed in to change notification settings - Fork 62
89 lines (77 loc) · 3.05 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
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
name: build
on: [push, pull_request, workflow_dispatch]
env:
IDE_VERSION: 1.8.19
TEENSY_VERSION: 159
IDE_LOCATION: /usr/local/share/arduino
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
board: ['Arduino Leonardo (Serial)', 'Arduino Leonardo (XInput)', 'Teensy 3.2', 'Teensy 4.0']
include:
- board: 'Arduino Leonardo (Serial)'
fqbn: arduino:avr:leonardo
- board: 'Arduino Leonardo (XInput)'
fqbn: xinput:avr:leonardo
- board: 'Teensy 3.2'
fqbn: teensy:avr:teensy31:usb=xinput,speed=72,opt=o2std,keys=en-us
- board: 'Teensy 4.0'
fqbn: teensy:avr:teensy40:usb=xinput,speed=600,opt=o2std,keys=en-us
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Arduino IDE
run: |
wget http://downloads.arduino.cc/arduino-$IDE_VERSION-linux64.tar.xz
tar xf arduino-$IDE_VERSION-linux64.tar.xz
sudo mv arduino-$IDE_VERSION /usr/local/share/arduino
sudo ln -s /usr/local/share/arduino/arduino /usr/local/bin/arduino
rm arduino-$IDE_VERSION-linux64.tar.xz
- name: Link XInput Library
run: ln --symbolic "$PWD" $IDE_LOCATION/libraries/
- name: Install Teensyduino
if: contains(matrix.board, 'Teensy')
run: |
wget https://www.pjrc.com/teensy/td_$TEENSY_VERSION/TeensyduinoInstall.linux64;
chmod +x ./TeensyduinoInstall.linux64;
sudo ./TeensyduinoInstall.linux64 --dir=/usr/local/share/arduino;
rm ./TeensyduinoInstall.linux64;
- name: Install Boards - XInput AVR
if: contains(matrix.fqbn, 'xinput:avr')
run: |
git clone https://github.com/dmadison/ArduinoXInput_AVR.git;
mkdir -p $IDE_LOCATION/hardware/xinput/avr;
mv ArduinoXInput_AVR/* $IDE_LOCATION/hardware/xinput/avr;
rm -rf ArduinoXInput_AVR;
- name: Install Boards - XInput Teensy
if: contains(matrix.board, 'Teensy')
run: |
git clone https://github.com/dmadison/ArduinoXInput_Teensy.git;
sudo \cp -r ArduinoXInput_Teensy/teensy $IDE_LOCATION/hardware;
rm -rf ArduinoXInput_Teensy;
sudo python ./.github/workflows/remove_teensyloader.py $IDE_LOCATION/hardware/teensy/avr/platform.txt
- name: Install Libraries for Examples
run: arduino --install-library "Nintendo Extension Ctrl:0.8.3"
- name: Build Examples
run: |
buildSketchPath() {
sktch=${1##*/examples/};
sktch=${sktch%/*.ino};
echo -e "\nBuilding sketch $sktch.ino";
arduino --verify --board ${{ matrix.fqbn }} "$1";
}
buildExampleSketch() {
buildSketchPath "$PWD/examples/$1/$1.ino";
}
buildExamples() {
IFS=$'\n'; set -f;
for f in $(find $PWD/examples/ -name '*.ino');
do
buildSketchPath $f;
done;
unset IFS; set +f;
}
buildExamples