Skip to content

Commit 57e561c

Browse files
committed
test: added micropython (UNIX-Port) unittest
1 parent 85fd355 commit 57e561c

20 files changed

+95
-5
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ jobs:
5252
pylint $(find -wholename './src/*.py')
5353
5454
55-
unittest:
56-
name: Unittests
55+
unittest_cpython:
56+
name: Unittests CPython
5757
runs-on: ubuntu-latest
5858
permissions:
5959
contents: read
@@ -80,7 +80,26 @@ jobs:
8080
pip install pyftdi
8181
- name: Run unittests
8282
run: |
83-
python -m unittest
83+
python -m unittest discover -s tests/cpython -p "test_*.py"
84+
85+
86+
unittest_micropython:
87+
name: Unittests MicroPython
88+
runs-on: ubuntu-latest
89+
permissions:
90+
contents: read
91+
92+
steps:
93+
- uses: actions/checkout@v6
94+
- name: Install MicroPython
95+
uses: BrianPugh/install-micropython@v2
96+
- name: Install dependencies
97+
run: |
98+
micropython -m mip install unittest
99+
micropython -m mip install unittest-discover
100+
- name: Test MicroPython
101+
run: |
102+
micropython -m unittest discover -s tests/micropython -p "test_*.py"
84103
85104
86105
code-coverage:
@@ -109,7 +128,7 @@ jobs:
109128
pip install pyftdi
110129
- name: Run unittests
111130
run: |
112-
python -m coverage run -m unittest discover
131+
python -m coverage run -m unittest discover -s tests/cpython -p "test_*.py"
113132
- name: Coverage comment
114133
id: coverage_comment
115134
uses: py-cov-action/python-coverage-comment-action@v3
@@ -195,7 +214,8 @@ jobs:
195214
name: Release and Publish Package
196215
runs-on: ubuntu-latest
197216
needs:
198-
- unittest
217+
- unittest_cpython
218+
- unittest_micropython
199219
if: github.ref == 'refs/heads/main'
200220
permissions:
201221
contents: write

tests/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)