Skip to content

Commit

Permalink
chore: update Python version constraint and add pytest-cov dependency…
Browse files Browse the repository at this point in the history
…; modify pytest workflow for improved coverage reporting

Signed-off-by: Jos Verlinde <Jos.Verlinde@microsoft.com>
  • Loading branch information
Josverl committed Feb 27, 2025
1 parent a7b273d commit 6007a6c
Show file tree
Hide file tree
Showing 3 changed files with 190 additions and 101 deletions.
30 changes: 12 additions & 18 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# This workflow will :
# - test the workstation scripts
# - test the createstubs on multiple micropyton linux versions
# - test the minified createstubs on multiple micropyton linux versions
# - test the createstubs on multiple micropyton linux versions
# - test the minified createstubs on multiple micropyton linux versions

# - upload coverage stats to Codecov
# - upload artifacts from the results folder
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: pytest stubber
on:
Expand Down Expand Up @@ -41,8 +39,8 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-13]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
mpflash-version: ["beta"]
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13"]
# mpflash-version: ["beta"]
include: # for testing
- os: windows-latest
python-version: "3.11"
Expand All @@ -69,7 +67,7 @@ jobs:
# poetry is not in the default image
#----------------------------------------------
- name: Install poetry
run: pipx install poetry==1.3.1
run: pipx install poetry==2.1

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
Expand Down Expand Up @@ -101,8 +99,7 @@ jobs:

- name: Test stubber
run: |
poetry run coverage erase
poetry run coverage run -m pytest -m stubber --durations=50
poetry run pytest --cov --cov-branch --cov-report=xml
#----------------------------------------------
# upload coverage stats
# .XML to Codecov
Expand All @@ -119,17 +116,14 @@ jobs:
continue-on-error: true
uses: codecov/codecov-action@v5
with:
file: results/coverage-stubber-${{ matrix.python-version }}-${{ matrix.os }}.xml
flags: stubber
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false

#----------------------------------------------


- uses: actions/upload-artifact@v4
if: always() # ignore errors
continue-on-error: true
with:
path: results/
name: results-stubber-${{ matrix.python-version }}-${{ matrix.os }}
# - uses: actions/upload-artifact@v4
# if: always() # ignore errors
# continue-on-error: true
# with:
# path: results/
# name: results-stubber-${{ matrix.python-version }}-${{ matrix.os }}
Loading

0 comments on commit 6007a6c

Please sign in to comment.