Skip to content

Commit

Permalink
Add error handling and update build configurations
Browse files Browse the repository at this point in the history
Modified compile-arduino-sketches.sh to include
error messages on compilation failure.
Updated build.yml to add new ones for STM32F1,
ESP8266, and nRF5.
Added Arduino-nRF5-excludes to exclude specific
example sketches from compilation.
  • Loading branch information
virtual-maker committed Jan 2, 2025
1 parent f2fc9ce commit 9c134a6
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/workflows/.ci_scripts/Arduino-nRF5-excludes
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
./examples/BatteryPoweredSensor/BatteryPoweredSensor.ino
./examples/CO2Sensor/CO2Sensor.ino
./examples/DustSensorDSM/DustSensorDSM.ino
./examples/GatewayESP8266/GatewayESP8266.ino
./examples/GatewayESP8266MQTTClient/GatewayESP8266MQTTClient.ino
./examples/GatewayESP8266SecureMQTTClient/GatewayESP8266SecureMQTTClient.ino
./examples/GatewayGSMMQTTClient/GatewayGSMMQTTClient.ino
./examples/GatewayESP8266OTA/GatewayESP8266OTA.ino
./examples/GatewayESP32/GatewayESP32.ino
./examples/GatewayESP32OTA/GatewayESP32OTA.ino
./examples/GatewayESP32MQTTClient/GatewayESP32MQTTClient.ino
./examples/GatewaySerialRS485/GatewaySerialRS485.ino
./examples/GatewayW5100/GatewayW5100.ino
./examples/GatewayW5100MQTTClient/GatewayW5100MQTTClient.ino
./examples/MotionSensorRS485/MotionSensorRS485.ino
./examples/SensebenderGatewaySerial/SensebenderGatewaySerial.ino
1 change: 1 addition & 0 deletions .github/workflows/.ci_scripts/compile-arduino-sketches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ while read sketch; do
arduino-cli compile --fqbn "$FQBN" "$sketch" --warnings more
compile_result=$?
if [ $compile_result -ne 0 ]; then
echo "::error::Unable to build $sketch"
exit_result=1
fi
else
Expand Down
61 changes: 60 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ jobs:
build-arduino-MySensors:
needs: static-code-tests
if: true # false # This will deactivate the job
if: false # This will deactivate the job
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -270,13 +270,15 @@ jobs:
# MySensors AVR MysensorsMicro
- name: Compile MysensorsMicro (tests)
#if: false # This will deactivate the step
run: |
FQBN="MySensors:avr:MysensorsMicro:cpu=1Mhz"
SKETCHES="./tests"
EXCLUDES="./.github/workflows/.ci_scripts/Arduino-AVR-excludes"
./.github/workflows/.ci_scripts/compile-arduino-sketches.sh $FQBN $SKETCHES $EXCLUDES
- name: Compile MysensorsMicro (examples)
#if: false # This will deactivate the step
run: |
FQBN="MySensors:avr:MysensorsMicro:cpu=1Mhz"
SKETCHES="./examples"
Expand All @@ -285,15 +287,72 @@ jobs:
# MySensors SAMD MySensorsGW
- name: Compile MySensorsGW (tests)
#if: false # This will deactivate the step
run: |
FQBN="MySensors:samd:mysensors_gw_native"
SKETCHES="./tests"
EXCLUDES="./.github/workflows/.ci_scripts/MySensors-SAMD-excludes"
./.github/workflows/.ci_scripts/compile-arduino-sketches.sh $FQBN $SKETCHES $EXCLUDES
- name: Compile MySensorsGW (examples)
#if: false # This will deactivate the step
run: |
FQBN="MySensors:samd:mysensors_gw_native"
SKETCHES="./examples"
EXCLUDES="./.github/workflows/.ci_scripts/MySensors-SAMD-excludes"
./.github/workflows/.ci_scripts/compile-arduino-sketches.sh $FQBN $SKETCHES $EXCLUDES
build-arduino-STM32F1:
needs: static-code-tests
if: false # This will deactivate the job
runs-on: ubuntu-latest

build-arduino-ESP8266:
needs: static-code-tests
if: false # This will deactivate the job
runs-on: ubuntu-latest

build-arduino-nRF5:
needs: static-code-tests
#if: false # This will deactivate the job
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set execute permissions for shell scripts
run: chmod +x ./.github/workflows/.ci_scripts/*.sh

- name: Set up Arduino CLI
uses: arduino/setup-arduino-cli@master

- name: Add library symlink to this MySensors repository
run: |
mkdir -p "$HOME/Arduino/libraries"
ln -s "$PWD" "$HOME/Arduino/libraries/."
- name: Install dependencies
run: |
arduino-cli config add board_manager.additional_urls https://sandeepmistry.github.io/arduino-nRF5/package_nRF5_boards_index.json
arduino-cli core update-index
arduino-cli core install sandeepmistry:nRF5
#arduino-cli lib install "Ethernet"
#arduino-cli lib install "SD"
# MySensors AVR MysensorsMicro
- name: Compile nRF52832 (tests)
#if: false # This will deactivate the step
run: |
FQBN="sandeepmistry:nRF5:Generic_nRF52832:softdevice=none,lfclk=lfxo"
SKETCHES="./tests"
EXCLUDES="./.github/workflows/.ci_scripts/Arduino-nRF5-excludes"
./.github/workflows/.ci_scripts/compile-arduino-sketches.sh $FQBN $SKETCHES $EXCLUDES
- name: Compile nRF52832 (examples)
#if: false # This will deactivate the step
run: |
FQBN="sandeepmistry:nRF5:Generic_nRF52832:softdevice=none,lfclk=lfxo"
SKETCHES="./examples"
EXCLUDES="./.github/workflows/.ci_scripts/Arduino-nRF5-excludes"
./.github/workflows/.ci_scripts/compile-arduino-sketches.sh $FQBN $SKETCHES $EXCLUDES

0 comments on commit 9c134a6

Please sign in to comment.