Skip to content

Commit 042dd4a

Browse files
committed
Test support of external Python package platform dependencies
Although Arduino boards platforms traditionally have bundled all dependencies, there are some cases where the user will need to use a preceeding workflow step to install external dependencies in the GitHub Actions runner environment. Since it is a "composite action", the action supports this. The action uses a virtual environment for its own Python package dependencies. This virtual environment might cause Python packages installed via the user's workflow (e.g., the pyserial dependency of the ESP32 platform) to not be accessible to the compilation commands. The added integration test will catch any regressions in the support for external Python package platform dependencies.
1 parent c4fa302 commit 042dd4a

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed

.github/workflows/test-integration.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ on:
1919

2020
env:
2121
SKETCHES_REPORTS_PATH: sketches-reports
22+
TESTDATA_PLATFORMS_PATH: .github/workflows/testdata/platforms
2223
TESTDATA_SKETCHES_PATH: .github/workflows/testdata/sketches
2324
TESTDATA_REPORTS_PATH: .github/workflows/testdata/reports
2425

@@ -203,6 +204,31 @@ jobs:
203204
sketch-paths: |
204205
- examples/Sweep
205206
207+
python-package-dependency:
208+
runs-on: ubuntu-latest
209+
210+
steps:
211+
- name: Checkout local repo
212+
uses: actions/checkout@v3
213+
214+
- name: Install Python package dependency
215+
run: pip install cowsay
216+
217+
- name: Run action with board that has external Python package dependency
218+
# Use action from local path
219+
uses: ./
220+
with:
221+
platforms: |
222+
- name: arduino:avr
223+
- source-path: ${{ env.TESTDATA_PLATFORMS_PATH }}/PythonPackageDependent
224+
name: PythonPackageDependent:avr
225+
fqbn: PythonPackageDependent:avr:package_dependent
226+
libraries: |
227+
[]
228+
sketch-paths: |
229+
- ${{ env.TESTDATA_SKETCHES_PATH }}/BareMinimum
230+
231+
206232
check-sketches-reports:
207233
needs: all-inputs
208234
runs-on: ubuntu-latest
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package_dependent.name=External Python Package Dependent Board
2+
package_dependent.upload.maximum_size=32256
3+
package_dependent.upload.maximum_data_size=2048
4+
package_dependent.build.mcu=atmega328p
5+
package_dependent.build.f_cpu=16000000L
6+
package_dependent.build.board=FOO
7+
package_dependent.build.core=arduino:arduino
8+
package_dependent.build.variant=arduino:standard
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Import external package to verify Python package dependencies can be installed by user into runner environment.
2+
import cowsay # noqa: F401
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
name=External Python Package Dependent Platform
2+
version=0.0.0
3+
recipe.hooks.prebuild.1.pattern=python "{runtime.platform.path}/dependent.py"

0 commit comments

Comments
 (0)