-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (63 loc) · 2.55 KB
/
Copy pathci.yml
File metadata and controls
73 lines (63 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: CI
# Manual-dispatch only (user call, 2026-07-17): the full local pytest
# suite already gates every commit, so per-push CI was noise — run it as
# part of cutting a beta zip instead:
# gh workflow run ci.yml --ref main (then gh run watch)
# Two independent gates:
# * tests — pytest against the source tree on the supported Python range.
# * package — kodi-addon-checker against a `git archive` extraction, i.e. the
# exact bytes that ship (export-ignore'd dev files excluded), so
# tests/, requirements-dev.txt, pytest.ini, etc. can never trip it.
on:
workflow_dispatch:
pull_request:
jobs:
tests:
name: pytest (py${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Floor = Kodi Nexus's xbmc.python 3.0.1 (CPython 3.8); ceiling = a
# current interpreter, to catch forward-compat breakage early.
python-version: ['3.8', '3.12']
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 dev dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run tests
run: python -m pytest
package:
name: addon-checker (git archive)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Build addon package from git archive
run: |
# Package exactly what ships. `git archive` honors .gitattributes
# export-ignore, so dev-only paths are absent. The extracted folder
# MUST be named for the addon id — kodi-addon-checker keys its id
# checks off the directory name. Derive it from addon.xml so the
# workflow can never drift from the id (this branch renamed it).
ADDON_ID=$(sed -n 's/.*<addon id="\([^"]*\)".*/\1/p' addon.xml)
echo "Addon id: $ADDON_ID"
mkdir -p "build/$ADDON_ID"
git archive --format=tar HEAD | tar -x -C "build/$ADDON_ID"
echo "Extracted package contents:"
ls -la "build/$ADDON_ID"
- name: Install kodi-addon-checker
run: |
python -m pip install --upgrade pip
pip install kodi-addon-checker
- name: Run kodi-addon-checker (nexus)
run: kodi-addon-checker --branch=nexus build/*/