feat: support get_pytest_cases
#4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python Tests with Coverage | |
on: | |
push: | |
branches: [main] | |
paths: | |
- "**.py" | |
pull_request: | |
branches: [main] | |
paths: | |
- "**.py" | |
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs | |
# `contents` is for permission to the contents of the repository. | |
# `pull-requests` is for permission to pull request | |
permissions: | |
contents: write | |
checks: write | |
pull-requests: write | |
jobs: | |
test-python: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.13"] | |
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 dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e '.[test]' | |
- name: Run tests with pytest and coverage | |
run: | | |
pytest --junitxml pytest.xml --cov-report term-missing:skip-covered --cov idf_ci tests/ | tee pytest-coverage.txt | |
- name: Upload coverage report to PR (Python 3.13 only) | |
if: matrix.python-version == '3.13' && github.event_name == 'pull_request' | |
uses: MishaKav/pytest-coverage-comment@v1 | |
with: | |
pytest-coverage-path: ./pytest-coverage.txt | |
junitxml-path: ./pytest.xml |