Skip to content

Commit

Permalink
fix(pio-build): use python venv
Browse files Browse the repository at this point in the history
See https://peps.python.org/pep-0668/

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
  • Loading branch information
fpistm committed Apr 29, 2024
1 parent 2aa5cde commit 4782f07
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 2 additions & 4 deletions .github/actions/pio-build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8

# Install prerequisites
RUN apt-get --quiet=2 update && apt-get install --quiet=2 --assume-yes git python3 python3-pip wget
RUN apt-get --quiet=2 update && apt-get install --quiet=2 --assume-yes git python3 python3-pip python3-venv wget

# Install 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
COPY entrypoint.sh /entrypoint.sh

# Code file to execute when the docker container starts up (`entrypoint.sh`)
ENTRYPOINT ["/entrypoint.sh"]
ENTRYPOINT ["/entrypoint.sh"]
8 changes: 7 additions & 1 deletion .github/actions/pio-build/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
#!/bin/bash
#!/bin/sh

readonly CMSIS_VERSION="$1"
readonly CMSIS_ARCHIVE="CMSIS-${CMSIS_VERSION}.tar.bz2"

# Use python venv
python3 -m venv "$HOME/venv"
. "$HOME/venv/bin/activate"
# Install PlatformIO
python3 -m pip install --quiet --upgrade platformio

# Install the development version of ststm32 platform
platformio platform install "https://github.com/platformio/platform-ststm32.git" || {
exit 1
Expand Down

0 comments on commit 4782f07

Please sign in to comment.