Repository navigation
89 lines (89 loc) · 3.5 KB
/
Copy pathci.yml
File metadata and controls
89 lines (89 loc) · 3.5 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: CI
on:
push:
branches: [main]
pull_request:
# A push supersedes the run for the same ref: the tree it tested is gone.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v5
with:
python-version: "3.14"
# ruff is a dev-only linter; the rule set lives in pyproject.toml, so
# these mean the same thing locally. Checking `.` rather than named
# directories keeps a new top-level script from silently escaping lint.
- run: pip install ruff==0.16.2
- run: ruff check .
- run: ruff format --check .
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v5
with:
python-version: "3.14"
# html5lib is the project's declared optional `reserialize` extra (core
# stays stdlib-only); installing it here lets CI exercise the
# --reserialize tests instead of skipping them.
- run: pip install . html5lib
- run: PYTHONPATH=src python -m unittest discover -s tests
core-compat:
name: Run the stack-free suite on the 3.12/3.13 floor
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# The install floor (decision 63): vir-tui/cquarry are marker-gated
# to 3.14 there, so these legs install the core (tqdm only) and run
# exactly the test modules that never touch the gated stack: the
# repair core, the plugin under calibre stubs, validate, the
# version/grammar pins, the RSC-016 comment-hyphen fix, the
# RepairFlags wiring pins, and the flags-driven real-core run.
# audit/library/CLI-stack tests stay on the 3.14 leg above.
python-version: ["3.12", "3.13"]
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: pip install . html5lib
- run: >
PYTHONPATH=src python -m unittest
tests.test_transforms tests.test_epub tests.test_pagination
tests.test_watermark tests.test_reserialize tests.test_version
tests.test_plugin tests.test_validate
tests.test_comment_hyphens tests.test_flags_wiring
tests.test_flags_real_core
plugin-compat:
name: Parse-check the plugin zip under the interpreters Calibre embeds
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# v0.39.0 shipped 3.14-only syntax and the plugin failed to load with
# a bare SyntaxError on every released Calibre. The embedded
# interpreters are 3.11 (7.x and the whole 8.x series) and 3.14
# (9.0+); 3.12/3.13 bracket the gap and match the CLI's grammar
# floor (tests/test_version.py). The plugin cannot be imported
# without Calibre, but the shipped zip can be extracted and
# byte-compiled, which catches exactly this class.
python-version: ["3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Build the plugin zip from this tree
run: python scripts/build_plugin.py
- name: Byte-compile the zip contents and the CLI sources
run: |
python -m zipfile -e dist/BinderyRepair-*.zip plugin_pkg
python -m compileall -q plugin_pkg src