Skip to content

Commit

Permalink
Added arduino action
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisxhe committed Sep 21, 2023
1 parent 063cc68 commit 346a2af
Showing 1 changed file with 100 additions and 0 deletions.
100 changes: 100 additions & 0 deletions .github/workflows/arduino_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
name: Arduino_CI

on:
push:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
board:
["esp32:esp32:esp32s2", "esp32:esp32:esp32s3", "esp32:esp32:esp32c3"]
examples:
[
examples/BAM423_Accelerometer/BAM423_Accelerometer.ino,
examples/BAM423_Orientation/BAM423_Orientation.ino,
examples/BAM423_Temperature/BAM423_Temperature.ino,
examples/BHI260AP_Accelerometer/BHI260AP_Accelerometer.ino,
examples/BMA423_Feature/BMA423_Feature.ino,
examples/CM32181_LightSensor/CM32181_LightSensor.ino,
examples/CM32181_LightSensorInterrupt/CM32181_LightSensorInterrupt.ino,
examples/DRV2605_Basic/DRV2605_Basic.ino,
examples/LTR553ALS_Sensor/LTR553ALS_Sensor.ino,
examples/PCF85063_SimpleTime/PCF85063_SimpleTime.ino,
examples/PCF8563_AlarmByUnits/PCF8563_AlarmByUnits.ino,
examples/PCF8563_SimpleTime/PCF8563_SimpleTime.ino,
examples/PCF8563_TimeLib/PCF8563_TimeLib.ino,
examples/PCF8563_TimeSynchronization/PCF8563_TimeSynchronization.ino,
examples/QMC6310_CalibrateExample/QMC6310_CalibrateExample.ino,
examples/QMC6310_CompassExample/QMC6310_CompassExample.ino,
examples/QMC6310_GetDataExample/QMC6310_GetDataExample.ino,
examples/QMC6310_GetPolarExample/QMC6310_GetPolarExample.ino,
examples/QMI8658_BlockExample/QMI8658_BlockExample.ino,
examples/QMI8658_GetDataExample/QMI8658_GetDataExample.ino,
examples/QMI8658_InterruptBlockExample/QMI8658_InterruptBlockExample.ino,
examples/QMI8658_InterruptExample/QMI8658_InterruptExample.ino,
examples/QMI8658_LockingMechanismExample/QMI8658_LockingMechanismExample.ino,
examples/QMI8658_MadgwickAHRS/QMI8658_MadgwickAHRS.ino,
examples/QMI8658_PedometerExample/QMI8658_PedometerExample.ino,
examples/QMI8658_ReadFromFifoExample/QMI8658_ReadFromFifoExample.ino,
examples/QMI8658_WakeOnMotion/QMI8658_WakeOnMotion.ino,
examples/QMI8658_WakeOnMotionCallBackExample/QMI8658_WakeOnMotionCallBackExample.ino,
examples/TouchDrv_CHSC5816_GetPoint/TouchDrv_CHSC5816_GetPoint.ino,
examples/TouchDrv_CSTxxx_GetPoint/TouchDrv_CSTxxx_GetPoint.ino,
examples/TouchDrv_FT3267_LilyGo_T_RGB/TouchDrv_FT3267_LilyGo_T_RGB.ino,
examples/TouchDrv_FT6232_GetPoint/TouchDrv_FT6232_GetPoint.ino,
examples/TouchDrv_GT911_GetPoint/TouchDrv_GT911_GetPoint.ino,
examples/TouchDrv_GT911_LilyGo_T_RGB/TouchDrv_GT911_LilyGo_T_RGB.ino,
examples/XL9555_ExtensionIOInterrupt/XL9555_ExtensionIOInterrupt.ino,
examples/XL9555_ExtensionIORead/XL9555_ExtensionIORead.ino,
examples/XL9555_ExtensionIOWirte/XL9555_ExtensionIOWirte.ino,
]

env:
ARDUINO_IDE_VERSION: 1.8.19
BOARD: ${{ matrix.board }}
EXAMPLES: ${{matrix.examples}}

steps:
- uses: actions/checkout@v3

- name: Install Arduino Ci
run: |
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16
sleep 3
export DISPLAY=:1.0
wget http://downloads.arduino.cc/arduino-$ARDUINO_IDE_VERSION-linux64.tar.xz ;
tar xf arduino-$ARDUINO_IDE_VERSION-linux64.tar.xz ;
rm arduino-$ARDUINO_IDE_VERSION-linux64.tar.xz ;
sudo mv arduino-$ARDUINO_IDE_VERSION /usr/local/share/arduino ;
sudo ln -s /usr/local/share/arduino/arduino /usr/local/bin/arduino ;
- name: Install esp32 core
run: |
if [[ "$BOARD" =~ "esp32:esp32:esp32s3" ]]; then
arduino --pref "boardsmanager.additional.urls=https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json" --save-prefs ;
arduino --install-boards esp32:esp32:2.0.13 ;
arduino --board $BOARD --save-prefs ;
arduino --pref "custom_CPUFreq=esp32s3_80" --save-prefs ;
arduino --pref "custom_DebugLevel=esp32s3_none" --save-prefs ;
arduino --pref "custom_FlashFreq=esp32s3_80" --save-prefs ;
arduino --pref "custom_FlashMode=esp32s3_dio" --save-prefs ;
arduino --pref "custom_FlashSize=esp32s3_8M" --save-prefs ;
arduino --pref "custom_USBMode=esp32s3_default" --save-prefs ;
arduino --pref "custom_CDCOnBoot=esp32s3_cdc" --save-prefs ;
arduino --pref "custom_PSRAM=esp32s3_enabled" --save-prefs ;
arduino --pref "custom_PartitionScheme=esp32s3_default_4MB" --save-prefs ;
arduino --pref "custom_UploadSpeed=esp32s3_921600" --save-prefs ;
cd $GITHUB_WORKSPACE ;
fi
- name: Build examples
run: |
if [[ "$BOARD" =~ "esp32:esp32:" ]]; then
arduino --verify --board $BOARD $PWD$EXAMPLES ;
fi ;

0 comments on commit 346a2af

Please sign in to comment.