Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
886 B

  1. #!/bin/bash
  2. set -eu -o pipefail
  3. CUSTOM_HEADER="espurna/config/custom.h"
  4. TARGET_ENVIRONMENT=${1:?"pio env name"}
  5. shift 1
  6. CONFIGURATIONS=(
  7. basic
  8. sensor
  9. emon
  10. light_my92xx
  11. light_dimmer
  12. nondefault
  13. )
  14. if [ $# > 0 ] ; then
  15. CONFIGURATIONS=("${CONFIGURATIONS[@]}" "$@")
  16. fi
  17. trap 'rm -f ${CUSTOM_HEADER}' EXIT
  18. for cfg in "${CONFIGURATIONS[@]}" ; do
  19. echo "travis_fold:start:build_${cfg}"
  20. echo "- building ${cfg}"
  21. printf "#define MANUFACTURER \"%s\"\n" "TEST_BUILD" \
  22. | tee ${CUSTOM_HEADER}
  23. printf "#define DEVICE \"%s\"\n" "${cfg^^}" \
  24. | tee --append ${CUSTOM_HEADER}
  25. tee --append ${CUSTOM_HEADER} < "test/build/${cfg}.h"
  26. export PLATFORMIO_SRC_BUILD_FLAGS="-DUSE_CUSTOM_H"
  27. export PLATFORMIO_BUILD_CACHE_DIR="test/pio_cache"
  28. time pio run -s -e "$TARGET_ENVIRONMENT"
  29. echo "travis_fold:end:build_${cfg}"
  30. done