|
| 1 | +name: build |
| 2 | + |
| 3 | +on: [push, pull_request, workflow_dispatch] |
| 4 | + |
| 5 | +env: |
| 6 | + IDE_VERSION: 1.8.13 |
| 7 | + IDE_LOCATION: /usr/local/share/arduino |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + compilation: ['Blank Sketch', 'USB API Demo', 'XInput Library'] |
| 16 | + include: |
| 17 | + - compilation: 'Blank Sketch' |
| 18 | + sketch: "$IDE_LOCATION/examples/01.Basics/BareMinimum/BareMinimum.ino" |
| 19 | + - compilation: 'USB API Demo' |
| 20 | + sketch: "$IDE_LOCATION/libraries/ArduinoXInput/extras/API-Demo/API-Demo.ino" |
| 21 | + - compilation: 'XInput Library' |
| 22 | + sketch: "$IDE_LOCATION/libraries/ArduinoXInput/examples/GamepadPins/GamepadPins.ino" |
| 23 | + |
| 24 | + steps: |
| 25 | + - name: Checkout |
| 26 | + uses: actions/checkout@v2 |
| 27 | + |
| 28 | + - name: Install Arduino IDE |
| 29 | + run: | |
| 30 | + wget http://downloads.arduino.cc/arduino-$IDE_VERSION-linux64.tar.xz |
| 31 | + tar xf arduino-$IDE_VERSION-linux64.tar.xz |
| 32 | + sudo mv arduino-$IDE_VERSION /usr/local/share/arduino |
| 33 | + sudo ln -s /usr/local/share/arduino/arduino /usr/local/bin/arduino |
| 34 | + rm arduino-$IDE_VERSION-linux64.tar.xz |
| 35 | +
|
| 36 | + - name: Install XInput AVR Boards |
| 37 | + run: | |
| 38 | + git clone https://github.com/dmadison/ArduinoXInput_AVR.git; |
| 39 | + mkdir -p $IDE_LOCATION/hardware/xinput/avr; |
| 40 | + mv ArduinoXInput_AVR/* $IDE_LOCATION/hardware/xinput/avr; |
| 41 | + rm -rf ArduinoXInput_AVR; |
| 42 | +
|
| 43 | + - name: Link SparkFun Boards Files |
| 44 | + run: ln -s $PWD/xinput_sparkfun $IDE_LOCATION/hardware |
| 45 | + |
| 46 | + - name: Install XInput Library |
| 47 | + if: contains(matrix.sketch, 'ArduinoXInput') |
| 48 | + run: | |
| 49 | + git clone https://github.com/dmadison/ArduinoXInput.git; |
| 50 | + sudo mv ArduinoXInput $IDE_LOCATION/libraries; |
| 51 | +
|
| 52 | + - name: Build All Boards |
| 53 | + run: | |
| 54 | + buildSketch() { |
| 55 | + echo -e "\nBuilding sketch ${{ matrix.sketch }} for $BOARD"; |
| 56 | + arduino --verify --board $BOARD ${{ matrix.sketch }}; |
| 57 | + } |
| 58 | +
|
| 59 | + BOARD=xinput_sparkfun:avr:makeymakey; buildSketch; |
| 60 | + BOARD=xinput_sparkfun:avr:promicro:cpu=16MHzatmega32U4; buildSketch; |
| 61 | + BOARD=xinput_sparkfun:avr:promicro:cpu=8MHzatmega32U4; buildSketch; |
| 62 | + BOARD=xinput_sparkfun:avr:fiov3; buildSketch; |
| 63 | + BOARD=xinput_sparkfun:avr:qduinomini; buildSketch; |
| 64 | + BOARD=xinput_sparkfun:avr:LilyPadProtoUSB; buildSketch |
0 commit comments