From d66a1705bef37150e8c2afc7f29a443ddadccf08 Mon Sep 17 00:00:00 2001 From: Rock Storm Date: Fri, 28 Jun 2024 19:34:26 +0200 Subject: [PATCH] ci: Split functional and unit testing This separation eases unit testing on more advanced Python versions by generating different environments for functional and unit testing. Which was impossible to do before due to lack of wxPython wheels. --- .github/workflows/test.yml | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 80b851c5b..b8df4bd67 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,15 +7,14 @@ on: pull_request: jobs: - test: + functional_test: + name: Functional testing with Python ${{ matrix.python-version }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: ["3.8", "3.9", "3.10", "3.11"] include: - # Set unit testing to false on all combinations - - unit-test: false - python-version: "3.8" wxpython-wheel: "ubuntu-22.04/wxPython-4.2.1-cp38-cp38-linux_x86_64.whl" - python-version: "3.9" @@ -23,7 +22,6 @@ jobs: - python-version: "3.10" wxpython-wheel: "ubuntu-22.04/wxPython-4.2.1-cp310-cp310-linux_x86_64.whl" - python-version: "3.11" - unit-test: true wxpython-wheel: "ubuntu-22.04/wxPython-4.2.1-cp311-cp311-linux_x86_64.whl" steps: @@ -46,10 +44,33 @@ jobs: python -m pip install -r requirements.txt - name: Perform functional tests + # Simple test that but might be enough to detect regressions + # particularly those due to wxPython versions run: | ./pronterface.py -h + unit_test: + name: Unit testing with Python ${{ matrix.python-version }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.11", "3.12", "3.13-dev"] + # Unit testing uses functions not available on Python < 3.11 + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install Printrun dependencies for unit testing + run: | + python -m pip install --upgrade pip + python -m pip install pyserial + - name: Perform unit tests - if: ${{ matrix.unit-test }} run: | python -m unittest discover tests