Bump mikepenz/action-junit-report from 4 to 5 #38
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: tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- "main" | |
jobs: | |
# Test all other supported Python version | |
testing-py3xx: | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox | |
- name: Run pytest with coverage | |
continue-on-error: true | |
run: | | |
tox -e test -- --junitxml=results.xml tests/ | |
- name: Test report | |
uses: mikepenz/action-junit-report@v5 | |
if: always() | |
with: | |
check_name: Test Report (${{ matrix.os }}, ${{ matrix.python }}) | |
report_paths: "**/results.xml" | |
detailed_summary: true | |
# Testing with Python 3.11 and coverage file artifacts | |
testing: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python: ["3.11"] | |
tests: ["", "-msgpack", "-jit"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox | |
- name: Run pytest with coverage | |
continue-on-error: true | |
run: | | |
tox -e test${{ matrix.tests }} -- --junitxml=results.xml tests/ | |
- name: Test report | |
uses: mikepenz/action-junit-report@v5 | |
if: always() | |
with: | |
check_name: Test Report (${{ matrix.os }}, ${{ matrix.python }}, ${{ matrix.tests }}) | |
report_paths: "**/results.xml" | |
detailed_summary: true | |
- name: Upload coverage | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: coverage-${{ matrix.python }}-${{ matrix.os }}${{ matrix.tests }} | |
path: "${{ github.workspace }}/.coverage*" | |
retention-days: 1 | |
# Collectiong and combining all coverage files | |
coverage: | |
needs: [testing] | |
strategy: | |
fail-fast: false | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Download coverage for testing | |
uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox | |
- name: Convert coverage | |
run: | | |
tox -e coverage | |
- name: Code Coverage Report | |
uses: irongut/CodeCoverageSummary@v1.3.0 | |
with: | |
filename: "**/coverage.xml" | |
badge: true | |
fail_below_min: true | |
format: markdown | |
hide_branch_rate: false | |
hide_complexity: true | |
indicators: true | |
output: both | |
thresholds: '50 75' |