Skip to content

fix: clear the 19 open SonarCloud findings #41

fix: clear the 19 open SonarCloud findings

fix: clear the 19 open SonarCloud findings #41

Workflow file for this run

name: tests
on: [push, pull_request]
jobs:
test:
# 3.11 is Kodi 21 (Omega)'s interpreter and the syntax floor; 3.13 guards
# against breakage on newer interpreters. Kodi 19/20 (3.8) are not targeted.
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.13"]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@v7
# uv.lock is committed and Renovate-maintained, but `pip install -e`
# ignored it and re-resolved every dependency on every run -- so CI
# tested whatever happened to be newest on PyPI that morning, not the
# pinned set. `--locked` installs the lockfile exactly and fails if
# the lock has drifted from pyproject.toml, and uv installs from
# wheels rather than executing sdist setup scripts.
- run: uv sync --locked --extra dev
- run: uv run --no-sync ruff check .
- run: uv run --no-sync pyright
# Tests that read bundled data skip in a copied tree (a mutation
# runner). In CI they must all run -- a skip here means the data is
# genuinely missing, which is a packaging regression.
- run: uv run --no-sync pytest -v --strict-markers -W error::UserWarning
- name: no tests were skipped
run: |
uv run --no-sync pytest -q 2>&1 | tee /tmp/pytest.out
if grep -qE '[0-9]+ skipped' /tmp/pytest.out; then
echo "Tests were skipped in CI; bundled data is likely missing."
exit 1
fi
- name: no kodi imports in pure modules
run: |
matches=$(grep -rn "^import xbmc\|^from xbmc" \
screensaver.splitflap/resources/lib/layout.py screensaver.splitflap/resources/lib/flap.py screensaver.splitflap/resources/lib/drum.py \
screensaver.splitflap/resources/lib/geometry.py screensaver.splitflap/resources/lib/glyphs.py screensaver.splitflap/resources/lib/charset.py \
screensaver.splitflap/resources/lib/compose.py screensaver.splitflap/resources/lib/rotator.py screensaver.splitflap/resources/lib/colour.py \
screensaver.splitflap/resources/lib/glyphgen.py screensaver.splitflap/resources/lib/sources/base.py screensaver.splitflap/resources/lib/sources/phrases.py \
screensaver.splitflap/resources/lib/sources/remote.py \
2>/dev/null || true)
if [ -n "$matches" ]; then
echo "Kodi import found in a pure module:"
echo "$matches"
exit 1
fi
- name: package addon
run: ./tools/build_addon.sh
- uses: actions/upload-artifact@v4
with:
name: addon-zip-${{ matrix.python-version }}
path: build/*.zip