Correct time offset typo #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Examples | |
# Triggers the workflow on push or pull request events | |
on: [push, pull_request] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
determine_library_source: | |
name: Determine the source of the testing library | |
uses: EnviroDIY/workflows/.github/workflows/determine_library_source.yaml@main | |
build_ex_arduino: | |
name: Arduino CLI ${{ matrix.example }} ${{ matrix.modem }} | |
runs-on: ubuntu-latest | |
needs: [determine_library_source] | |
env: | |
LIBRARY_INSTALL_ZIP: ${{ needs.determine_library_source.outputs.library_install_zip }} | |
strategy: | |
matrix: | |
example: [examples/AllFunctions] | |
modem: [LORA_AT_MDOT, LORA_AT_LORAE5] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Write the requirements file | |
run: | | |
echo "wheel" > requirements.txt | |
echo "adafruit-nrfutil" >> requirements.txt | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
cache: 'pip' | |
- name: Install python dependencies, including NRF-Utils needed for Adafruit Feathers | |
run: | | |
pip install -r requirements.txt | |
# We use the `arduino/setup-arduino-cli` action to install and | |
# configure the Arduino CLI on the system. | |
- name: Setup Arduino CLI | |
uses: arduino/[email protected] | |
- name: Restore Arduino platforms | |
uses: actions/cache/restore@v4 | |
id: restore_platforms | |
with: | |
path: | | |
home/arduino/data | |
key: ${{ hashFiles('continuous_integration/install-platforms-arduino-cli.sh') }} | |
# Install cores for the Arduino CLI, iff no cache | |
- name: Install the Arduino Platforms | |
id: install_platforms | |
if: steps.restore_platforms.outputs.cache-hit != 'true' | |
run: | | |
chmod +x continuous_integration/install-platforms-arduino-cli.sh | |
sh continuous_integration/install-platforms-arduino-cli.sh | |
- name: Restore Arduino libraries | |
uses: actions/cache/restore@v4 | |
id: restore_libraries | |
if: ${{ steps.check_lib_install.outputs.valid_lib_dep_script == 'true'}} | |
with: | |
path: | | |
home/arduino/user | |
key: ${{ hashFiles('continuous_integration/install-libraries-arduino-cli.sh') }} | |
# Install any library dependencies for the Arduino CLI, iff no cache | |
# NOTE: Don't update the dependencies beyond what's in the install script! | |
- name: Install the Arduino libraries | |
id: install_libraries | |
if: ${{ (steps.check_lib_install.outputs.valid_lib_dep_script == 'true') && (steps.restore_libraries.outputs.cache-hit != 'true') }} | |
run: | | |
chmod +x continuous_integration/install-libraries-arduino-cli.sh | |
sh continuous_integration/install-libraries-arduino-cli.sh | |
# Install the test library for the Arduino CLI | |
- name: Install the testing version of the library for the Arduino CLI | |
id: install_test_library | |
run: | | |
curl -SL https://raw.githubusercontent.com/EnviroDIY/workflows/main/scripts/install-test-version-arduino-cli.sh -o install-test-version-arduino-cli.sh | |
chmod +x install-test-version-arduino-cli.sh | |
sh install-test-version-arduino-cli.sh | |
- name: Include problem matcher | |
uses: ammaraskar/gcc-problem-matcher@master | |
# Run the script to compile the examples | |
- name: Compile | |
env: | |
ARDUINO_CODE_SOURCE: ${{ matrix.example }} | |
LORA_AT_MODEM_TO_USE: ${{ matrix.modem }} | |
run: | | |
set -e # Exit with nonzero exit code if anything fails | |
if [ "$RUNNER_DEBUG" = "1" ]; then | |
echo "Enabling debugging!" | |
set -v # Prints shell input lines as they are read. | |
set -x # Print command traces before executing command. | |
fi | |
status=0 | |
sed -i 's/#define LORA_AT_/\/\/ #define LORA_AT_/g' ${{ matrix.example }}/* | |
sed -i '1s/^/#define ${{ matrix.modem }} /' ${{ matrix.example }}/* | |
echo ::group::EnviroDIY:avr:envirodiy_mayfly | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn EnviroDIY:avr:envirodiy_mayfly ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mEnviroDIY:avr:envirodiy_mayfly successfully compiled\e[0m"; else echo -e "\e[31mEnviroDIY:avr:envirodiy_mayfly failed to compile\e[0m"; fi | |
echo ::group::arduino:avr:uno | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:avr:uno ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:avr:uno successfully compiled\e[0m"; else echo -e "\e[31marduino:avr:uno failed to compile\e[0m"; fi | |
echo ::group::arduino:avr:mega | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:avr:mega ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:avr:mega successfully compiled\e[0m"; else echo -e "\e[31marduino:avr:mega failed to compile\e[0m"; fi | |
echo ::group::arduino:avr:leonardo | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:avr:leonardo ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:avr:leonardo successfully compiled\e[0m"; else echo -e "\e[31marduino:avr:leonardo failed to compile\e[0m"; fi | |
echo ::group::arduino:sam:arduino_due_x | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:sam:arduino_due_x ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:sam:arduino_due_x successfully compiled\e[0m"; else echo -e "\e[31marduino:sam:arduino_due_x failed to compile\e[0m"; fi | |
echo ::group::arduino:samd:mzero_bl | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:samd:mzero_bl ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:samd:mzero_bl successfully compiled\e[0m"; else echo -e "\e[31marduino:samd:mzero_bl failed to compile\e[0m"; fi | |
echo ::group::arduino:samd:mkrvidor4000 | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:samd:mkrvidor4000 ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:samd:mkrvidor4000 successfully compiled\e[0m"; else echo -e "\e[31marduino:samd:mkrvidor4000 failed to compile\e[0m"; fi | |
echo ::group::arduino:megaavr:uno2018 | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:megaavr:uno2018 ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:megaavr:uno2018 successfully compiled\e[0m"; else echo -e "\e[31marduino:megaavr:uno2018 failed to compile\e[0m"; fi | |
echo ::group::arduino:megaavr:nona4809 | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:megaavr:nona4809 ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:megaavr:nona4809 successfully compiled\e[0m"; else echo -e "\e[31marduino:megaavr:nona4809 failed to compile\e[0m"; fi | |
echo ::group::arduino:esp32:nano_nora | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:esp32:nano_nora ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:esp32:nano_nora successfully compiled\e[0m"; else echo -e "\e[31marduino:esp32:nano_nora failed to compile\e[0m"; fi | |
echo ::group::arduino:mbed_rp2040:pico | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:mbed_rp2040:pico ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:mbed_rp2040:pico successfully compiled\e[0m"; else echo -e "\e[31marduino:mbed_rp2040:pico failed to compile\e[0m"; fi | |
echo ::group::arduino:renesas_uno:unor4wifi | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:renesas_uno:unor4wifi ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:renesas_uno:unor4wifi successfully compiled\e[0m"; else echo -e "\e[31marduino:renesas_uno:unor4wifi failed to compile\e[0m"; fi | |
echo ::group::arduino:mbed_nano:nano33ble | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:mbed_nano:nano33ble ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:mbed_nano:nano33ble successfully compiled\e[0m"; else echo -e "\e[31marduino:mbed_nano:nano33ble failed to compile\e[0m"; fi | |
echo ::group::arduino:mbed_portenta:envie_m7 | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn arduino:mbed_portenta:envie_m7 ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32marduino:mbed_portenta:envie_m7 successfully compiled\e[0m"; else echo -e "\e[31marduino:mbed_portenta:envie_m7 failed to compile\e[0m"; fi | |
echo ::group::adafruit:avr:feather328p | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn adafruit:avr:feather328p ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32madafruit:avr:feather328p successfully compiled\e[0m"; else echo -e "\e[31madafruit:avr:feather328p failed to compile\e[0m"; fi | |
echo ::group::adafruit:avr:feather32u4 | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn adafruit:avr:feather32u4 ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32madafruit:avr:feather32u4 successfully compiled\e[0m"; else echo -e "\e[31madafruit:avr:feather32u4 failed to compile\e[0m"; fi | |
echo ::group::adafruit:samd:adafruit_feather_m0 | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn adafruit:samd:adafruit_feather_m0 ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32madafruit:samd:adafruit_feather_m0 successfully compiled\e[0m"; else echo -e "\e[31madafruit:samd:adafruit_feather_m0 failed to compile\e[0m"; fi | |
echo ::group::adafruit:samd:adafruit_feather_m4 | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn adafruit:samd:adafruit_feather_m4 ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32madafruit:samd:adafruit_feather_m4 successfully compiled\e[0m"; else echo -e "\e[31madafruit:samd:adafruit_feather_m4 failed to compile\e[0m"; fi | |
echo ::group::adafruit:samd:adafruit_grandcentral_m4 | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn adafruit:samd:adafruit_grandcentral_m4 ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32madafruit:samd:adafruit_grandcentral_m4 successfully compiled\e[0m"; else echo -e "\e[31madafruit:samd:adafruit_grandcentral_m4 failed to compile\e[0m"; fi | |
echo ::group::esp8266:esp8266:huzzah | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn esp8266:esp8266:huzzah ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mesp8266:esp8266:huzzah successfully compiled\e[0m"; else echo -e "\e[31mesp8266:esp8266:huzzah failed to compile\e[0m"; fi | |
echo ::group::esp32:esp32:featheresp32 | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn esp32:esp32:featheresp32 ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mesp32:esp32:featheresp32 successfully compiled\e[0m"; else echo -e "\e[31mesp32:esp32:featheresp32 failed to compile\e[0m"; fi | |
echo ::group::STMicroelectronics:stm32:GenF4 | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn STMicroelectronics:stm32:GenF4 ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mSTMicroelectronics:stm32:GenF4 successfully compiled\e[0m"; else echo -e "\e[31mSTMicroelectronics:stm32:GenF4 failed to compile\e[0m"; fi | |
echo ::group::esp8266:esp8266:nodemcu | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn esp8266:esp8266:nodemcu ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mesp8266:esp8266:nodemcu successfully compiled\e[0m"; else echo -e "\e[31mesp8266:esp8266:nodemcu failed to compile\e[0m"; fi | |
echo ::group::esp8266:esp8266:nodemcuv2 | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn esp8266:esp8266:nodemcuv2 ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mesp8266:esp8266:nodemcuv2 successfully compiled\e[0m"; else echo -e "\e[31mesp8266:esp8266:nodemcuv2 failed to compile\e[0m"; fi | |
echo ::group::esp32:esp32:esp32 | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn esp32:esp32:esp32 ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mesp32:esp32:esp32 successfully compiled\e[0m"; else echo -e "\e[31mesp32:esp32:esp32 failed to compile\e[0m"; fi | |
echo ::group::esp32:esp32:esp32c3 | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn esp32:esp32:esp32c3 ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mesp32:esp32:esp32c3 successfully compiled\e[0m"; else echo -e "\e[31mesp32:esp32:esp32c3 failed to compile\e[0m"; fi | |
echo ::group::esp32:esp32:esp32c6 | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn esp32:esp32:esp32c6 ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mesp32:esp32:esp32c6 successfully compiled\e[0m"; else echo -e "\e[31mesp32:esp32:esp32c6 failed to compile\e[0m"; fi | |
echo ::group::esp32:esp32:esp32s3 | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn esp32:esp32:esp32s3 ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mesp32:esp32:esp32s3 successfully compiled\e[0m"; else echo -e "\e[31mesp32:esp32:esp32s3 failed to compile\e[0m"; fi | |
echo ::group::teensy:avr:teensy36 | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn teensy:avr:teensy36 ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mteensy:avr:teensy36 successfully compiled\e[0m"; else echo -e "\e[31mteensy:avr:teensy36 failed to compile\e[0m"; fi | |
echo ::group::teensy:avr:teensy40 | |
arduino-cli compile --warnings more --config-file continuous_integration/arduino_cli.yaml --format text --fqbn teensy:avr:teensy40 ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mteensy:avr:teensy40 successfully compiled\e[0m"; else echo -e "\e[31mteensy:avr:teensy40 failed to compile\e[0m"; fi | |
exit $status | |
- name: Uninstall testing version of the library before caching | |
run: | | |
arduino-cli --config-file continuous_integration/arduino_cli.yaml lib uninstall ${GITHUB_REPOSITORY#*/} | |
- name: Cache Arduino platforms | |
uses: actions/cache/save@v4 | |
id: cache_platforms | |
if: ${{ always() }} | |
with: | |
path: | | |
home/arduino/data | |
key: ${{ steps.restore_platforms.outputs.cache-primary-key }} | |
- name: Cache Arduino libraries | |
uses: actions/cache/save@v4 | |
id: cache_libraries | |
if: ${{ always() && steps.check_lib_install.outputs.valid_lib_dep_script == 'true'}} | |
with: | |
path: | | |
home/arduino/user | |
key: ${{ steps.restore_libraries.outputs.cache-primary-key }} | |
build_pio: | |
name: PlatformIO ${{ matrix.example }} ${{ matrix.modem }} | |
runs-on: ubuntu-latest | |
needs: [determine_library_source] | |
env: | |
LIBRARY_INSTALL_GIT: ${{ needs.determine_library_source.outputs.library_install_git }} | |
strategy: | |
matrix: | |
example: [examples/AllFunctions] | |
modem: [LORA_AT_MDOT, LORA_AT_LORAE5] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup PlatformIO | |
uses: EnviroDIY/[email protected] | |
- name: Restore PlatformIO platforms | |
uses: actions/cache/restore@v4 | |
id: restore_platforms | |
with: | |
path: | | |
~/.platformio/packages | |
~/.platformio/platforms | |
~/.platformio/caches | |
key: ${{ hashFiles('continuous_integration/install-platforms-platformio.sh') }} | |
# Install the PlatformIO platforms at global level, iff no cache | |
- name: Install PlatformIO platforms | |
id: install_platforms | |
if: steps.restore_platforms.outputs.cache-hit != 'true' | |
run: | | |
chmod +x continuous_integration/install-platforms-platformio.sh | |
sh continuous_integration/install-platforms-platformio.sh | |
- name: Restore PlatformIO libraries | |
uses: actions/cache/restore@v4 | |
id: restore_libraries | |
if: ${{ steps.check_lib_install.outputs.valid_lib_dep_script == 'true'}} | |
with: | |
path: | | |
~/.platformio/lib | |
$GITHUB_WORKSPACE/lib | |
key: ${{ hashFiles('continuous_integration/install-libraries-platformio.sh') }} | |
# Install any library dependencies with PlatformIO at the global level, iff no cache | |
- name: Install PlatformIO libraries | |
id: install_libraries | |
if: ${{ (steps.check_lib_install.outputs.valid_lib_dep_script == 'true') && (steps.restore_libraries.outputs.cache-hit != 'true') }} | |
run: | | |
chmod +x continuous_integration/install-libraries-platformio.sh | |
sh continuous_integration/install-libraries-platformio.sh | |
cp -a /home/runner/.platformio/lib/. $GITHUB_WORKSPACE/lib/ | |
# Install the library at the Global level for PlatformIO | |
- name: Install the testing version of the library for PlatformIO | |
id: install_test_library | |
run: | | |
pio pkg install --skip-dependencies -g --library ${{ env.LIBRARY_INSTALL_GIT }} | |
pio pkg list -g --only-libraries | |
- name: Include problem matcher | |
uses: ammaraskar/gcc-problem-matcher@master | |
- name: Compile | |
env: | |
PLATFORMIO_CI_SRC: ${{ matrix.example }} | |
LORA_AT_MODEM_TO_USE: ${{ matrix.modem }} | |
run: | | |
set -e # Exit with nonzero exit code if anything fails | |
if [ "$RUNNER_DEBUG" = "1" ]; then | |
echo "Enabling debugging!" | |
set -v # Prints shell input lines as they are read. | |
set -x # Print command traces before executing command. | |
fi | |
status=0 | |
sed -i 's/#define LORA_AT_/\/\/ #define LORA_AT_/g' ${{ matrix.example }}/* | |
sed -i '1s/^/#define ${{ matrix.modem }} /' ${{ matrix.example }}/* | |
echo ::group::mayfly | |
pio ci --project-conf "continuous_integration/platformio.ini" --environment mayfly ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mmayfly successfully compiled\e[0m"; else echo -e "\e[31mmayfly failed to compile\e[0m"; fi | |
echo ::group::uno | |
pio ci --project-conf "continuous_integration/platformio.ini" --environment uno ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32muno successfully compiled\e[0m"; else echo -e "\e[31muno failed to compile\e[0m"; fi | |
echo ::group::mega | |
pio ci --project-conf "continuous_integration/platformio.ini" --environment mega ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mmega successfully compiled\e[0m"; else echo -e "\e[31mmega failed to compile\e[0m"; fi | |
echo ::group::leonardo | |
pio ci --project-conf "continuous_integration/platformio.ini" --environment leonardo ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mleonardo successfully compiled\e[0m"; else echo -e "\e[31mleonardo failed to compile\e[0m"; fi | |
echo ::group::zero | |
pio ci --project-conf "continuous_integration/platformio.ini" --environment zero ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mzero successfully compiled\e[0m"; else echo -e "\e[31mzero failed to compile\e[0m"; fi | |
echo ::group::nano_esp32 | |
pio ci --project-conf "continuous_integration/platformio.ini" --environment nano_esp32 ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mnano_esp32 successfully compiled\e[0m"; else echo -e "\e[31mnano_esp32 failed to compile\e[0m"; fi | |
echo ::group::feather328p | |
pio ci --project-conf "continuous_integration/platformio.ini" --environment feather328p ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mfeather328p successfully compiled\e[0m"; else echo -e "\e[31mfeather328p failed to compile\e[0m"; fi | |
echo ::group::feather32u4 | |
pio ci --project-conf "continuous_integration/platformio.ini" --environment feather32u4 ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mfeather32u4 successfully compiled\e[0m"; else echo -e "\e[31mfeather32u4 failed to compile\e[0m"; fi | |
echo ::group::feather_m0 | |
pio ci --project-conf "continuous_integration/platformio.ini" --environment feather_m0 ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mfeather_m0 successfully compiled\e[0m"; else echo -e "\e[31mfeather_m0 failed to compile\e[0m"; fi | |
echo ::group::feather_m4 | |
pio ci --project-conf "continuous_integration/platformio.ini" --environment feather_m4 ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mfeather_m4 successfully compiled\e[0m"; else echo -e "\e[31mfeather_m4 failed to compile\e[0m"; fi | |
echo ::group::huzzah | |
pio ci --project-conf "continuous_integration/platformio.ini" --environment huzzah ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mhuzzah successfully compiled\e[0m"; else echo -e "\e[31mhuzzah failed to compile\e[0m"; fi | |
echo ::group::featheresp32 | |
pio ci --project-conf "continuous_integration/platformio.ini" --environment featheresp32 ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mfeatheresp32 successfully compiled\e[0m"; else echo -e "\e[31mfeatheresp32 failed to compile\e[0m"; fi | |
echo ::group::esp32-c3 | |
pio ci --project-conf "continuous_integration/platformio.ini" --environment esp32-c3 ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mesp32-c3 successfully compiled\e[0m"; else echo -e "\e[31mesp32-c3 failed to compile\e[0m"; fi | |
echo ::group::esp32-s3 | |
pio ci --project-conf "continuous_integration/platformio.ini" --environment esp32-s3 ${{ matrix.example }} 2>&1 | tee output.log | |
result_code=${PIPESTATUS[0]} | |
if [ "$result_code" -eq "0" ] && [ "$status" -eq "0" ]; then status=0; else status=1; fi | |
echo ::endgroup:: | |
if [ "$result_code" -eq "0" ]; then echo -e "\e[32mesp32-s3 successfully compiled\e[0m"; else echo -e "\e[31mesp32-s3 failed to compile\e[0m"; fi | |
exit $status | |
- name: Uninstall testing version before caching | |
run: | | |
pio pkg uninstall --skip-dependencies -g --library LoRa_AT | |
- name: Cache PlatformIO platforms | |
uses: actions/cache/save@v4 | |
id: cache_platforms | |
if: ${{ always() }} | |
with: | |
path: | | |
~/.platformio/packages | |
~/.platformio/platforms | |
~/.platformio/caches | |
key: ${{ steps.restore_platforms.outputs.cache-primary-key }} | |
- name: Cache PlatformIO libraries | |
uses: actions/cache/save@v4 | |
id: cache_libraries | |
if: ${{ always() && steps.check_lib_install.outputs.valid_lib_dep_script == 'true'}} | |
with: | |
path: | | |
~/.platformio/lib | |
$GITHUB_WORKSPACE/lib | |
key: ${{ steps.restore_libraries.outputs.cache-primary-key }} |