diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af3481c..1eb9fbd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -132,23 +132,37 @@ jobs: branch=$(python3 -c "import xml.etree.ElementTree as ET; print(ET.parse('$report').getroot().get('branch-rate'))") echo "line-rate=$line" echo "branch-rate=$branch" - python3 - <= {want:.0%}") + if not ok: + rows = [] + for cls in root.iter("class"): + lines = cls.find("lines") + total = len(lines.findall("line")) if lines is not None else 0 + if total: + rows.append((float(cls.get("line-rate")), total, cls.get("name"))) + rows.sort() + print("\nLeast-covered classes (line%, lines, name):") + for rate, total, name in rows[:15]: + print(f" {rate:6.1%} {total:5d} {name}") + sys.exit(0 if ok else 1) EOF - name: Upload coverage report - if: matrix.os == 'ubuntu-latest' + # always(): the gate above fails the job, and without this the coverage report -- + # the only artifact that explains why -- is never uploaded. + if: always() && matrix.os == 'ubuntu-latest' uses: actions/upload-artifact@v7 with: name: coverage