2019-09-30 01:01:29 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-10-02 10:58:02 +02:00
|
|
|
set -e
|
|
|
|
|
2019-09-30 01:01:29 +02:00
|
|
|
if [ ! -z "$TRAVIS_TAG" ]; then
|
|
|
|
echo "Skipping Test: Tagged build"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -z "$GITHUB_WORKSPACE" ]; then
|
|
|
|
export TRAVIS_BUILD_DIR="$GITHUB_WORKSPACE"
|
|
|
|
export TRAVIS_REPO_SLUG="$GITHUB_REPOSITORY"
|
|
|
|
elif [ ! -z "$TRAVIS_BUILD_DIR" ]; then
|
|
|
|
export GITHUB_WORKSPACE="$TRAVIS_BUILD_DIR"
|
|
|
|
export GITHUB_REPOSITORY="$TRAVIS_REPO_SLUG"
|
|
|
|
else
|
|
|
|
export GITHUB_WORKSPACE="$PWD"
|
|
|
|
export GITHUB_REPOSITORY="espressif/arduino-esp32"
|
|
|
|
fi
|
|
|
|
|
|
|
|
CHUNK_INDEX=$1
|
|
|
|
CHUNKS_CNT=$2
|
|
|
|
BUILD_PIO=0
|
2019-09-30 11:10:48 +02:00
|
|
|
if [ "$#" -lt 2 ] || [ "$CHUNKS_CNT" -le 0 ]; then
|
2019-09-30 01:01:29 +02:00
|
|
|
CHUNK_INDEX=0
|
|
|
|
CHUNKS_CNT=1
|
2021-04-14 17:10:05 +02:00
|
|
|
elif [ "$CHUNK_INDEX" -gt "$CHUNKS_CNT" ] && [ "$CHUNKS_CNT" -ge 2 ]; then
|
2019-09-30 01:01:29 +02:00
|
|
|
CHUNK_INDEX=$CHUNKS_CNT
|
2019-09-30 11:10:48 +02:00
|
|
|
elif [ "$CHUNK_INDEX" -eq "$CHUNKS_CNT" ]; then
|
2019-09-30 01:01:29 +02:00
|
|
|
BUILD_PIO=1
|
|
|
|
fi
|
|
|
|
|
2021-04-05 13:23:58 +02:00
|
|
|
#echo "Updating submodules ..."
|
|
|
|
#git -C "$GITHUB_WORKSPACE" submodule update --init --recursive > /dev/null 2>&1
|
2019-10-01 09:44:04 +02:00
|
|
|
|
2019-09-30 01:01:29 +02:00
|
|
|
if [ "$BUILD_PIO" -eq 0 ]; then
|
2021-04-05 13:23:58 +02:00
|
|
|
# ArduinoIDE ESP32 Test
|
|
|
|
TARGET="esp32"
|
2019-09-30 11:10:48 +02:00
|
|
|
FQBN="espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app"
|
2019-10-01 09:44:04 +02:00
|
|
|
source ./.github/scripts/install-arduino-ide.sh
|
|
|
|
source ./.github/scripts/install-arduino-core-esp32.sh
|
2019-09-30 11:10:48 +02:00
|
|
|
if [ "$OS_IS_WINDOWS" == "1" ]; then
|
|
|
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino" && \
|
|
|
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/BLE/examples/BLE_server/BLE_server.ino" && \
|
|
|
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino"
|
|
|
|
elif [ "$OS_IS_MACOS" == "1" ]; then
|
|
|
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
|
|
|
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino" && \
|
|
|
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino" && \
|
|
|
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/BLE/examples/BLE_server/BLE_server.ino" && \
|
|
|
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino"
|
|
|
|
else
|
|
|
|
# CMake Test
|
|
|
|
if [ "$CHUNK_INDEX" -eq 0 ]; then
|
2019-10-01 09:44:04 +02:00
|
|
|
bash "$ARDUINO_ESP32_PATH/.github/scripts/check-cmakelists.sh"
|
2019-09-30 11:10:48 +02:00
|
|
|
fi
|
2021-04-05 13:23:58 +02:00
|
|
|
build_sketches "$FQBN" "$TARGET" "$ARDUINO_ESP32_PATH/libraries" "$CHUNK_INDEX" "$CHUNKS_CNT"
|
2019-09-30 11:10:48 +02:00
|
|
|
fi
|
2021-04-05 13:23:58 +02:00
|
|
|
|
|
|
|
# ArduinoIDE ESP32S2 Test
|
|
|
|
TARGET="esp32s2"
|
|
|
|
FQBN="espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=huge_app"
|
|
|
|
if [ "$OS_IS_WINDOWS" == "1" ]; then
|
2021-04-14 17:10:05 +02:00
|
|
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
|
|
|
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
|
|
|
|
elif [ "$OS_IS_MACOS" == "1" ]; then
|
|
|
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
|
|
|
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
|
|
|
|
else
|
|
|
|
build_sketches "$FQBN" "$TARGET" "$ARDUINO_ESP32_PATH/libraries" "$CHUNK_INDEX" "$CHUNKS_CNT"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# ArduinoIDE ESP32C3 Test
|
|
|
|
TARGET="esp32c3"
|
|
|
|
FQBN="espressif:esp32:esp32c3:PartitionScheme=huge_app"
|
|
|
|
if [ "$OS_IS_WINDOWS" == "1" ]; then
|
2021-04-05 13:23:58 +02:00
|
|
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
|
|
|
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
|
|
|
|
elif [ "$OS_IS_MACOS" == "1" ]; then
|
|
|
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
|
|
|
|
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
|
|
|
|
else
|
|
|
|
build_sketches "$FQBN" "$TARGET" "$ARDUINO_ESP32_PATH/libraries" "$CHUNK_INDEX" "$CHUNKS_CNT"
|
|
|
|
fi
|
2019-09-30 01:01:29 +02:00
|
|
|
else
|
2019-10-01 09:44:04 +02:00
|
|
|
source ./.github/scripts/install-platformio-esp32.sh
|
2021-04-05 13:23:58 +02:00
|
|
|
# PlatformIO ESP32 Test
|
2019-09-30 11:10:48 +02:00
|
|
|
BOARD="esp32dev"
|
2021-04-05 13:23:58 +02:00
|
|
|
OPTIONS="board_build.partitions = huge_app.csv"
|
|
|
|
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
|
|
|
|
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino" && \
|
|
|
|
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino" && \
|
|
|
|
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/BLE/examples/BLE_server/BLE_server.ino" && \
|
|
|
|
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino"
|
|
|
|
|
|
|
|
# PlatformIO ESP32 Test
|
|
|
|
# OPTIONS="board_build.mcu = esp32s2"
|
|
|
|
# build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
|
|
|
|
# build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
|
|
|
|
|
|
|
|
python -m platformio ci --board "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient" --project-option="board_build.mcu = esp32s2" --project-option="board_build.partitions = huge_app.csv"
|
|
|
|
|
|
|
|
#build_pio_sketches "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries"
|
2019-09-30 11:10:48 +02:00
|
|
|
fi
|