Skip to content

Commit 9339c00

Browse files
authored
ci(release): Add JSON install test (espressif#10104)
1 parent 5aaa49e commit 9339c00

File tree

1 file changed

+47
-1
lines changed

1 file changed

+47
-1
lines changed

Diff for: .github/scripts/on-release.sh

+47-1
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,53 @@ if [ "$RELEASE_PRE" == "false" ]; then
421421
fi
422422
fi
423423

424-
# Upload package JSONs (temporary halted to fix json generation)
424+
# Test the package JSONs
425+
426+
echo "Installing arduino-cli ..."
427+
source ./.github/scripts/install-arduino-cli.sh
428+
429+
echo "Testing $PACKAGE_JSON_DEV install ..."
430+
echo "Updating index ..."
431+
arduino-cli core update-index --additional-urls "file://$OUTPUT_DIR/$PACKAGE_JSON_DEV"
432+
if [ $? -ne 0 ]; then echo "ERROR: Failed to update index ($?)"; exit 1; fi
433+
434+
echo "Installing esp32 ..."
435+
arduino-cli core install esp32:esp32
436+
if [ $? -ne 0 ]; then echo "ERROR: Failed to install esp32 ($?)"; exit 1; fi
437+
438+
echo "Compiling example ..."
439+
arduino-cli compile --fqbn espressif:esp32:esp32 $GITHUB_WORKSPACE/libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino
440+
if [ $? -ne 0 ]; then echo "ERROR: Failed to compile example ($?)"; exit 1; fi
441+
442+
echo "Uninstalling esp32 ..."
443+
arduino-cli core uninstall esp32:esp32
444+
if [ $? -ne 0 ]; then echo "ERROR: Failed to uninstall esp32 ($?)"; exit 1; fi
445+
446+
echo "Test successful!"
447+
448+
if [ "$RELEASE_PRE" == "false" ]; then
449+
echo "Testing $PACKAGE_JSON_REL install ..."
450+
echo "Updating index ..."
451+
arduino-cli core update-index --additional-urls "file://$OUTPUT_DIR/$PACKAGE_JSON_REL"
452+
if [ $? -ne 0 ]; then echo "ERROR: Failed to update index ($?)"; exit 1; fi
453+
454+
echo "Installing esp32 ..."
455+
arduino-cli core install esp32:esp32
456+
if [ $? -ne 0 ]; then echo "ERROR: Failed to install esp32 ($?)"; exit 1; fi
457+
458+
echo "Compiling example ..."
459+
arduino-cli compile --fqbn espressif:esp32:esp32 $GITHUB_WORKSPACE/libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino
460+
if [ $? -ne 0 ]; then echo "ERROR: Failed to compile example ($?)"; exit 1; fi
461+
462+
echo "Uninstalling esp32 ..."
463+
arduino-cli core uninstall esp32:esp32
464+
if [ $? -ne 0 ]; then echo "ERROR: Failed to uninstall esp32 ($?)"; exit 1; fi
465+
466+
echo "Test successful!"
467+
fi
468+
469+
# Upload package JSONs
470+
425471
echo "Uploading $PACKAGE_JSON_DEV ..."
426472
echo "Download URL: "`git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_DEV"`
427473
echo "Pages URL: "`git_safe_upload_to_pages "$PACKAGE_JSON_DEV" "$OUTPUT_DIR/$PACKAGE_JSON_DEV"`

0 commit comments

Comments
 (0)