Skip to content

Update macro conditions for ESP8266 and ESP32 #### #51

Update macro conditions for ESP8266 and ESP32 ####

Update macro conditions for ESP8266 and ESP32 #### #51

Workflow file for this run

name: Build Arduino Project
on:
push:
branches:
- main
- master
- development
- dev_actions
pull_request:
branches:
- main
- master
- development
- dev_actions
# Allows you to run this workflow manually from the Actions tab for every branch
workflow_dispatch:
jobs:
get_commits:
runs-on: ubuntu-latest
outputs:
commits: ${{ steps.get_commits.outputs.commits }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get list of commits
id: get_commits
run: |
# Use `--no-merges` if you want to exclude merge commits
commits=$(git rev-list --reverse --format="format:%H" --no-merges ${{ github.event.before }}..${{ github.sha }} | grep -v "^commit ")
# Convert the list of hashes into a JSON array
commits_json=$(echo "$commits" | jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "commits=$commits_json" >> $GITHUB_OUTPUT
#### ToDo: Check if the output is correct
echo "C"
echo "$commits_json"
echo "D"
commit-msg-tests:
runs-on: ubuntu-latest
strategy:
matrix:
commit: ${{ fromJson(needs.get_commits.outputs.commits || '[]') }}
needs: get_commits
steps:
#### ToDo: Check if the output is correct
- name: Debug commits output
run: |
echo "Commits: ${{ matrix.commit }}"
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: ${{ matrix.commit }}
- name: Set execute permissions for shell scripts
run: chmod +x ./.github/workflows/.ci_scripts/*.sh
- name: Check commit message format
run: ./.github/workflows/.ci_scripts/check-commit-message.sh
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: Check missing keywords and keywords format
run: ./.github/workflows/.ci_scripts/check-missing-keywords.sh
- name: Install astyle
run: sudo apt-get install -y astyle
- name: Check wellformed code style with astyle app
id: check_astyle
run: ./.github/workflows/.ci_scripts/check-astyle-code.sh
continue-on-error: true
- name: Upload astyle restyling.patch file if exists
if: ${{ steps.check_astyle.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: restyling.patch
path: restyling.patch
- name: End job execution on astyle error
if: ${{ steps.check_astyle.outcome == 'failure' }}
run: |
# End job execution with error.
echo "::error::Code style is not wellformed. Find the Git restyling.patch in Artifacts section below."
exit 1
- name: Install cppcheck
run: sudo apt-get install -y cppcheck
- name: Run static code analysis with cppcheck
id: cppcheck_avr
run: ./.github/workflows/.ci_scripts/check-static-cpp-code.sh
continue-on-error: true
- name: Upload cppcheck reports artifact
if: ${{ steps.cppcheck_avr.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: cppcheck-avr.xml
path: cppcheck-avr.xml
- name: Upload cppcheck reports folder
if: ${{ steps.cppcheck_avr.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: cppcheck_reports_folder
path: cppcheck-avr_cppcheck_reports/
- name: End job execution on cppcheck error
if: ${{ steps.cppcheck_avr.outcome == 'failure' }}
run: |
# End job execution with error.
echo "::error::C++ Code with errors detected. See detailed report in Artifacts section below."
exit 1
build-arduino-AVR:
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 core update-index
arduino-cli core install arduino:avr
arduino-cli lib install "Ethernet"
#### Example of compiling a single sketch
#- name: Compile a single and specific sketch
# run: |
# arduino-cli compile --fqbn arduino:avr:uno ./examples/LightSensor/LightSensor.ino
# Arduino AVR UNO
- name: Compile ArduinoUno (tests)
run: |
# Fully Qualified Board Name (FQBN) of the board to compile for
FQBN="arduino:avr:uno"
# path to the Arduino sketches directory
SKETCHES="./tests"
# Define the path to the blacklist file
EXCLUDES="./.github/workflows/.ci_scripts/Arduino-AVR-excludes"
# Run the script to compile all sketches
./.github/workflows/.ci_scripts/compile-arduino-sketches.sh $FQBN $SKETCHES $EXCLUDES
- name: Compile ArduinoUno (examples)
run: |
FQBN="arduino:avr:uno"
SKETCHES="./examples"
EXCLUDES="./.github/workflows/.ci_scripts/Arduino-AVR-excludes"
./.github/workflows/.ci_scripts/compile-arduino-sketches.sh $FQBN $SKETCHES $EXCLUDES
# Arduino AVR MEGA
- name: Compile ArduinoMega (tests)
run: |
FQBN="arduino:avr:mega:cpu=atmega2560"
SKETCHES="./tests"
EXCLUDES="./.github/workflows/.ci_scripts/Arduino-AVR-excludes"
./.github/workflows/.ci_scripts/compile-arduino-sketches.sh $FQBN $SKETCHES $EXCLUDES
- name: Compile ArduinoMega (examples)
run: |
FQBN="arduino:avr:mega:cpu=atmega2560"
SKETCHES="./examples"
EXCLUDES="./.github/workflows/.ci_scripts/Arduino-AVR-excludes"
./.github/workflows/.ci_scripts/compile-arduino-sketches.sh $FQBN $SKETCHES $EXCLUDES
build-arduino-ESP32:
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://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json
arduino-cli config add board_manager.additional_urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
arduino-cli core update-index
arduino-cli core install esp32:esp32
#arduino-cli lib install "Ethernet"
- name: Compile ESP32 (tests)
run: |
FQBN="esp32:esp32:esp32:PSRAM=disabled,PartitionScheme=default,CPUFreq=240,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,DebugLevel=none"
SKETCHES="./tests"
EXCLUDES="./.github/workflows/.ci_scripts/Arduino-ESP32-excludes"
./.github/workflows/.ci_scripts/compile-arduino-sketches.sh $FQBN $SKETCHES $EXCLUDES
- name: Compile ESP32 (examples)
run: |
FQBN="esp32:esp32:esp32:PSRAM=disabled,PartitionScheme=default,CPUFreq=240,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,DebugLevel=none"
SKETCHES="./examples"
EXCLUDES="./.github/workflows/.ci_scripts/Arduino-ESP32-excludes"
./.github/workflows/.ci_scripts/compile-arduino-sketches.sh $FQBN $SKETCHES $EXCLUDES
build-arduino-MySensors:
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://raw.githubusercontent.com/mysensors/ArduinoBoards/master/package_mysensors.org_index.json
arduino-cli core update-index
arduino-cli core install arduino:avr
arduino-cli core install arduino:samd
arduino-cli core install MySensors:avr
arduino-cli core install MySensors:samd
arduino-cli lib install "Ethernet"
arduino-cli lib install "SD"
# 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"
EXCLUDES="./.github/workflows/.ci_scripts/Arduino-AVR-excludes"
./.github/workflows/.ci_scripts/compile-arduino-sketches.sh $FQBN $SKETCHES $EXCLUDES
# 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
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"
build-arduino-ESP8266:
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://arduino.esp8266.com/stable/package_esp8266com_index.json
arduino-cli core update-index
arduino-cli core install esp8266:esp8266
#arduino-cli lib install "Ethernet"
#arduino-cli lib install "SD"
# arduino ESP8266 generic
- name: Compile ESP8266 (tests)
#if: false # This will deactivate the step
run: |
FQBN="esp8266:esp8266:generic:xtal=80,vt=flash,exception=disabled,ResetMethod=ck,CrystalFreq=26,FlashFreq=40,FlashMode=dout,eesz=512K,led=2,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=115200"
SKETCHES="./tests"
EXCLUDES="./.github/workflows/.ci_scripts/Arduino-ESP8266-excludes"
./.github/workflows/.ci_scripts/compile-arduino-sketches.sh $FQBN $SKETCHES $EXCLUDES
- name: Compile ESP8266 (examples)
#if: false # This will deactivate the step
run: |
FQBN="esp8266:esp8266:generic:xtal=80,vt=flash,exception=disabled,ResetMethod=ck,CrystalFreq=26,FlashFreq=40,FlashMode=dout,eesz=512K,led=2,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=115200"
SKETCHES="./examples"
EXCLUDES="./.github/workflows/.ci_scripts/Arduino-ESP8266-excludes"
./.github/workflows/.ci_scripts/compile-arduino-sketches.sh $FQBN $SKETCHES $EXCLUDES
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"
# arduino-nRF5 Generic_nRF52832
- name: Compile Generic_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 Generic_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
# arduino-nRF5 Generic_nRF51822
- name: Compile Generic_nRF51822 (tests)
#if: false # This will deactivate the step
run: |
FQBN="sandeepmistry:nRF5:Generic_nRF51822:chip=xxaa,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 Generic_nRF51822 (examples)
#if: false # This will deactivate the step
run: |
FQBN="sandeepmistry:nRF5:Generic_nRF51822:chip=xxaa,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