Skip to content

Commit e1d6da4

Browse files
committed
fix(json): Skip requirements if libs are not installed
1 parent 613536a commit e1d6da4

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

Diff for: .github/scripts/sketch_utils.sh

+21-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#!/bin/bash
22

3-
SDKCONFIG_DIR="$ARDUINO_ESP32_PATH/tools/esp32-arduino-libs"
3+
if [ -d "$ARDUINO_ESP32_PATH/tools/esp32-arduino-libs" ]; then
4+
SDKCONFIG_DIR="$ARDUINO_ESP32_PATH/tools/esp32-arduino-libs"
5+
elif [ -d "$GITHUB_WORKSPACE/tools/esp32-arduino-libs" ]; then
6+
SDKCONFIG_DIR="$GITHUB_WORKSPACE/tools/esp32-arduino-libs"
7+
else
8+
SDKCONFIG_DIR="tools/esp32-arduino-libs"
9+
fi
410

511
function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [extra-options]
612
while [ ! -z "$1" ]; do
@@ -278,10 +284,11 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
278284
unset options
279285
}
280286

281-
function count_sketches(){ # count_sketches <path> [target] [file]
287+
function count_sketches(){ # count_sketches <path> [target] [file] [ignore-requirements]
282288
local path=$1
283289
local target=$2
284290
local file=$3
291+
local ignore_requirements=$4
285292

286293
if [ $# -lt 1 ]; then
287294
echo "ERROR: Illegal number of parameters"
@@ -314,16 +321,18 @@ function count_sketches(){ # count_sketches <path> [target] [file]
314321
continue
315322
fi
316323

317-
# Check if the sketch requires any configuration options
318-
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
319-
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
320-
for requirement in $requirements; do
321-
requirement=$(echo $requirement | xargs)
322-
found_line=$(grep -E "^$requirement" $SDKCONFIG_DIR/$target/sdkconfig)
323-
if [[ "$found_line" == "" ]]; then
324-
continue 2
325-
fi
326-
done
324+
if [[ "$ignore_requirements" != "1" ]]; then
325+
# Check if the sketch requires any configuration options
326+
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
327+
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
328+
for requirement in $requirements; do
329+
requirement=$(echo $requirement | xargs)
330+
found_line=$(grep -E "^$requirement" $SDKCONFIG_DIR/$target/sdkconfig)
331+
if [[ "$found_line" == "" ]]; then
332+
continue 2
333+
fi
334+
done
335+
fi
327336
fi
328337
fi
329338
echo $sketch >> sketches.txt

Diff for: .github/scripts/tests_run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ else
233233
fi
234234

235235
set +e
236-
${COUNT_SKETCHES} $test_folder $target
236+
${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
237237
sketchcount=$?
238238
set -e
239239
sketches=$(cat sketches.txt)

0 commit comments

Comments
 (0)