From 6d0cc4606ea714952a9f164304040a2325ddc369 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Fri, 18 Oct 2024 13:41:42 +0300 Subject: [PATCH] Github workflows: Fix platformio to use venv Otherwise gets "This environment is externally managed" --- .github/workflows/platformio_tests.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/platformio_tests.yml b/.github/workflows/platformio_tests.yml index 39dea48f..4448c0ce 100644 --- a/.github/workflows/platformio_tests.yml +++ b/.github/workflows/platformio_tests.yml @@ -31,22 +31,25 @@ jobs: - name: Install and setup PlatformIO run: | - pip3 install -U platformio - export PATH=~/.local/bin:$PATH + python3 -m venv venv + venv/bin/pip3 install -U platformio - name: Build PlatformIO package run: | + source venv/bin/activate cd nanopb pio package pack - name: Example - Extract PlatformIO package to example dir run: | + source venv/bin/activate cp -R nanopb/examples/platformio example mkdir -p example/lib/nanopb tar -xzf nanopb/Nanopb-*.tar.gz -C example/lib/nanopb - name: Example - Build run: | + source venv/bin/activate cd example pio run @@ -58,6 +61,7 @@ jobs: - name: Build in subdirectory with space characters run: | + source venv/bin/activate cp -R nanopb/examples/platformio "example with spaces" mkdir -p "example with spaces/lib/nanopb" tar -xzf nanopb/Nanopb-*.tar.gz -C "example with spaces/lib/nanopb" @@ -66,6 +70,7 @@ jobs: - name: Build with default platformio.ini run: | + source venv/bin/activate mkdir -p test_default_pio_conf cd test_default_pio_conf pio project init