fix: let Kodi's file browser actually list the served repository #73
This file contains hidden or 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: [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 }} | |
| # Pinned by commit SHA: a mutable tag lets the action's owner | |
| # change what runs in CI after review. Renovate tracks the | |
| # trailing version comment. | |
| - uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | |
| # 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. | |
| # --no-install-project + --no-build: every dependency comes from a | |
| # wheel named in the lockfile, and nothing runs a setup script. The | |
| # project itself is never built because pytest resolves its imports | |
| # through pythonpath in pyproject.toml, not through an install. | |
| - run: uv sync --locked --extra dev --no-install-project --no-build | |
| - run: uv run --no-sync --no-build ruff check . | |
| - run: uv run --no-sync --no-build 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 --no-build pytest -v --strict-markers -W error::UserWarning | |
| - name: no tests were skipped | |
| run: | | |
| uv run --no-sync --no-build 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@v7 | |
| with: | |
| name: addon-zip-${{ matrix.python-version }} | |
| path: build/*.zip |