Skip to content

Commit cd4ff07

Browse files
committed
[CI] Handle failed commands in PlatformIO action
Signed-off-by: Frederic Pillon <[email protected]>
1 parent 91eb78c commit cd4ff07

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

.github/actions/pio-build/entrypoint.sh

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,26 @@ CMSIS_VERSION="$1"
44
CMSIS_ARCHIVE="CMSIS-${CMSIS_VERSION}.tar.bz2"
55

66
# Install the development version of ststm32 platform
7-
platformio platform install "https://github.com/platformio/platform-ststm32.git"
8-
7+
platformio platform install "https://github.com/platformio/platform-ststm32.git" || {
8+
exit 1
9+
}
910
# Prepare framework for CI
10-
python3 -c "import json; import os; fp=open(os.path.expanduser('~/.platformio/platforms/ststm32/platform.json'), 'r+'); data=json.load(fp); data['packages']['framework-arduinoststm32']['version'] = '*'; fp.seek(0); fp.truncate(); json.dump(data, fp); fp.close()"
11-
12-
ln -sf "$GITHUB_WORKSPACE" "$HOME/.platformio/packages/framework-arduinoststm32"
11+
python3 -c "import json; import os; fp=open(os.path.expanduser('~/.platformio/platforms/ststm32/platform.json'), 'r+'); data=json.load(fp); data['packages']['framework-arduinoststm32']['version'] = '*'; fp.seek(0); fp.truncate(); json.dump(data, fp); fp.close()" || {
12+
exit 1
13+
}
14+
ln -sf "$GITHUB_WORKSPACE" "$HOME/.platformio/packages/framework-arduinoststm32" || {
15+
exit 1
16+
}
1317
# Download and unpack CMSIS package
14-
wget --no-verbose "https://github.com/stm32duino/ArduinoModule-CMSIS/releases/download/$CMSIS_VERSION/$CMSIS_ARCHIVE"
15-
tar -xjf "$CMSIS_ARCHIVE"
16-
cd "$GITHUB_WORKSPACE/CI/build/"
18+
wget --no-verbose "https://github.com/stm32duino/ArduinoModule-CMSIS/releases/download/$CMSIS_VERSION/$CMSIS_ARCHIVE" || {
19+
exit 1
20+
}
21+
tar -xjf "$CMSIS_ARCHIVE" || {
22+
exit 1
23+
}
24+
cd "$GITHUB_WORKSPACE/CI/build/" || {
25+
exit 1
26+
}
1727
python3 platformio-builder.py --board=blackpill_f103c8 --board=remram_v1
1828

1929
exit $?

0 commit comments

Comments
 (0)