From 84e758ce10339e83a3fbb5046b1b21e1208a547d Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 9 Nov 2020 06:14:05 -0800 Subject: [PATCH 1/2] Give Python virtual environment access to system site-packages directory Use the` venv --system-site-packages` flag when creating the Python virtual environment the action's script runs in to allow users to install Python package dependencies of their sketch's boards platform dependencies. The immediate need for this is that the ESP32 boards platform has a dependency on the `pyserial` Python package. The alternative would be to always install this specific package in the setup script, but allowing the user to install arbitrary Python package dependencies makes the action more flexible. The cons: - Increased complexity of workflows compiling for ESP32 platform boards. - Risk of the runner's default packages interfering with the script. --- action-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action-setup.sh b/action-setup.sh index 4022b68..9f32d9b 100755 --- a/action-setup.sh +++ b/action-setup.sh @@ -29,7 +29,7 @@ sudo apt-get install --yes python3-setuptools > /dev/null sudo apt-get install --yes python${PYTHON_PACKAGE_VERSION}-venv > /dev/null # Create Python virtual environment -"$PYTHON_COMMAND" -m venv "$PYTHON_VENV_PATH" +"$PYTHON_COMMAND" -m venv --system-site-packages "$PYTHON_VENV_PATH" # Activate Python virtual environment # shellcheck source=/dev/null From 22571ca4f307cb26c568e4bdd14c8c37c1eb0248 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 9 Nov 2020 06:29:44 -0800 Subject: [PATCH 2/2] Run integration test CI workflow when action-setup.sh is modified --- .github/workflows/test-integration.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 6022b46..e738e4c 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -6,6 +6,7 @@ on: - '.github/workflows/test-integration.yml' - '.github/workflows/testdata' - 'action.yml' + - 'action-setup.sh' - 'compilesketches/**' push: @@ -13,6 +14,7 @@ on: - '.github/workflows/test-integration.yml' - '.github/workflows/testdata' - 'action.yml' + - 'action-setup.sh' - 'compilesketches/**' env: