Skip to content

Commit 4782f07

Browse files
committed
fix(pio-build): use python venv
See https://peps.python.org/pep-0668/ Signed-off-by: Frederic Pillon <[email protected]>
1 parent 2aa5cde commit 4782f07

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Diff for: .github/actions/pio-build/Dockerfile

+2-4
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ ENV LANG C.UTF-8
55
ENV LC_ALL C.UTF-8
66

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

10-
# Install PlatformIO
11-
RUN pip3 install --quiet --upgrade platformio
1210
CMD /bin/bash
1311

1412
# Copies your code file from your action repository to the filesystem path `/` of the container
1513
COPY entrypoint.sh /entrypoint.sh
1614

1715
# Code file to execute when the docker container starts up (`entrypoint.sh`)
18-
ENTRYPOINT ["/entrypoint.sh"]
16+
ENTRYPOINT ["/entrypoint.sh"]

Diff for: .github/actions/pio-build/entrypoint.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
#!/bin/bash
1+
#!/bin/sh
22

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

6+
# Use python venv
7+
python3 -m venv "$HOME/venv"
8+
. "$HOME/venv/bin/activate"
9+
# Install PlatformIO
10+
python3 -m pip install --quiet --upgrade platformio
11+
612
# Install the development version of ststm32 platform
713
platformio platform install "https://github.com/platformio/platform-ststm32.git" || {
814
exit 1

0 commit comments

Comments
 (0)