diff --git a/.github/scripts/sketch_utils.sh b/.github/scripts/sketch_utils.sh index 8316c328e9c..b9ce41653f2 100755 --- a/.github/scripts/sketch_utils.sh +++ b/.github/scripts/sketch_utils.sh @@ -1,6 +1,12 @@ #!/bin/bash -SDKCONFIG_DIR="$ARDUINO_ESP32_PATH/tools/esp32-arduino-libs" +if [ -d "$ARDUINO_ESP32_PATH/tools/esp32-arduino-libs" ]; then + SDKCONFIG_DIR="$ARDUINO_ESP32_PATH/tools/esp32-arduino-libs" +elif [ -d "$GITHUB_WORKSPACE/tools/esp32-arduino-libs" ]; then + SDKCONFIG_DIR="$GITHUB_WORKSPACE/tools/esp32-arduino-libs" +else + SDKCONFIG_DIR="tools/esp32-arduino-libs" +fi function build_sketch(){ # build_sketch [extra-options] while [ ! -z "$1" ]; do @@ -278,10 +284,11 @@ function build_sketch(){ # build_sketch [ex unset options } -function count_sketches(){ # count_sketches [target] [file] +function count_sketches(){ # count_sketches [target] [file] [ignore-requirements] local path=$1 local target=$2 local file=$3 + local ignore_requirements=$4 if [ $# -lt 1 ]; then echo "ERROR: Illegal number of parameters" @@ -314,16 +321,18 @@ function count_sketches(){ # count_sketches [target] [file] continue fi - # Check if the sketch requires any configuration options - requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json) - if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then - for requirement in $requirements; do - requirement=$(echo $requirement | xargs) - found_line=$(grep -E "^$requirement" $SDKCONFIG_DIR/$target/sdkconfig) - if [[ "$found_line" == "" ]]; then - continue 2 - fi - done + if [[ "$ignore_requirements" != "1" ]]; then + # Check if the sketch requires any configuration options + requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json) + if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then + for requirement in $requirements; do + requirement=$(echo $requirement | xargs) + found_line=$(grep -E "^$requirement" $SDKCONFIG_DIR/$target/sdkconfig) + if [[ "$found_line" == "" ]]; then + continue 2 + fi + done + fi fi fi echo $sketch >> sketches.txt diff --git a/.github/scripts/tests_run.sh b/.github/scripts/tests_run.sh index be084e90ce2..dfef2e3b28c 100755 --- a/.github/scripts/tests_run.sh +++ b/.github/scripts/tests_run.sh @@ -233,7 +233,7 @@ else fi set +e - ${COUNT_SKETCHES} $test_folder $target + ${COUNT_SKETCHES} $test_folder $target "1" # Ignore requirements as we don't have the libs. The requirements will be checked in the run_test function sketchcount=$? set -e sketches=$(cat sketches.txt)