diff --git a/.github/actions/pio-build/Dockerfile b/.github/actions/pio-build/Dockerfile index c6ff9d567f..edf0d63576 100644 --- a/.github/actions/pio-build/Dockerfile +++ b/.github/actions/pio-build/Dockerfile @@ -5,10 +5,10 @@ ENV LANG C.UTF-8 ENV LC_ALL C.UTF-8 # Install prerequisites -RUN apt-get update && apt-get install -y git python3 python3-pip wget +RUN apt-get --quiet=2 update && apt-get install --quiet=2 --assume-yes git python3 python3-pip wget # Install PlatformIO -RUN pip3 install -U platformio +RUN pip3 install --quiet --upgrade platformio CMD /bin/bash # Copies your code file from your action repository to the filesystem path `/` of the container diff --git a/.github/actions/pio-build/entrypoint.sh b/.github/actions/pio-build/entrypoint.sh index 3ddc08c7bd..b51c1ba630 100755 --- a/.github/actions/pio-build/entrypoint.sh +++ b/.github/actions/pio-build/entrypoint.sh @@ -1,19 +1,29 @@ -#!/bin/bash -x +#!/bin/bash -CMSIS_VERSION=$1 -CMSIS_ARCHIVE=CMSIS-${CMSIS_VERSION}.tar.bz2 +readonly CMSIS_VERSION="$1" +readonly CMSIS_ARCHIVE="CMSIS-${CMSIS_VERSION}.tar.bz2" # Install the development version of ststm32 platform -platformio platform install https://github.com/platformio/platform-ststm32.git - +platformio platform install "https://github.com/platformio/platform-ststm32.git" || { + exit 1 +} # Prepare framework for CI -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()" - -ln -sf $GITHUB_WORKSPACE $HOME/.platformio/packages/framework-arduinoststm32 +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()" || { + exit 1 +} +ln --symbolic "$GITHUB_WORKSPACE" "$HOME/.platformio/packages/framework-arduinoststm32" || { + exit 1 +} # Download and unpack CMSIS package -wget https://github.com/stm32duino/ArduinoModule-CMSIS/releases/download/$CMSIS_VERSION/CMSIS-$CMSIS_VERSION.tar.bz2 -tar -xvjf CMSIS-$CMSIS_VERSION.tar.bz2 -cd $GITHUB_WORKSPACE/CI/build/ +wget --no-verbose "https://github.com/stm32duino/ArduinoModule-CMSIS/releases/download/$CMSIS_VERSION/$CMSIS_ARCHIVE" || { + exit 1 +} +tar --extract --bzip2 --file="$CMSIS_ARCHIVE" || { + exit 1 +} +cd "$GITHUB_WORKSPACE/CI/build/" || { + exit 1 +} python3 platformio-builder.py --board=blackpill_f103c8 --board=remram_v1 exit $?