diff --git a/.github/workflows/.ci_scripts/Arduino-AVR-UNO-excludes b/.github/workflows/.ci_scripts/Arduino-AVR-UNO-excludes new file mode 100644 index 000000000..11280b5df --- /dev/null +++ b/.github/workflows/.ci_scripts/Arduino-AVR-UNO-excludes @@ -0,0 +1,8 @@ +examples/GatewayESP8266/GatewayESP8266.ino +examples/GatewayESP8266MQTTClient/GatewayESP8266MQTTClient.ino +examples/GatewayESP8266SecureMQTTClient/GatewayESP8266SecureMQTTClient.ino +examples/GatewayESP8266OTA/GatewayESP8266OTA.ino +examples/GatewayESP32/GatewayESP32.ino +examples/GatewayESP32OTA/GatewayESP32OTA.ino +examples/GatewayESP32MQTTClient/GatewayESP32MQTTClient.ino +examples/SensebenderGatewaySerial/SensebenderGatewaySerial.ino \ No newline at end of file diff --git a/.github/workflows/.ci_scripts/compile-arduino-AVR-UNO-sketches.sh b/.github/workflows/.ci_scripts/compile-arduino-AVR-UNO-sketches.sh new file mode 100644 index 000000000..88f24169a --- /dev/null +++ b/.github/workflows/.ci_scripts/compile-arduino-AVR-UNO-sketches.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Read the blacklist file into an array +if [ -f Arduino-AVR-excludes ]; then + mapfile -t excludes < Arduino-AVR-UNO-excludes +else + excludes=() +fi + +# Find all .ino files and compile each one, excluding those in the blacklist +find ./examples -name "*.ino" | while read sketch; do + if [[ ! " ${excludes[@]} " =~ " ${sketch} " ]]; then + echo "Compiling $sketch" + arduino-cli compile --fqbn arduino:avr:uno "$sketch" + else + echo "Skipping $sketch (blacklisted)" + fi +done diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ee8264b56..787615851 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -157,3 +157,6 @@ jobs: - name: Compile sketch run: | arduino-cli compile --fqbn arduino:avr:uno ./examples/LightSensor/LightSensor.ino + + - name: Compile all sketches from examples folder + run: ./.github/workflows/.ci_scripts/compile-arduino-AVR-UNO-sketches.sh