mirror of
https://github.com/openmlsys/openmlsys-zh.git
synced 2026-10-29 19:45:57 +08:00
- Remap 129 broken image paths in v1/en_chapters to the files that exist under v1/img (old chapter numbering, renamed files, and .pdf figures that browsers cannot display inline). - Restore ch07/7.5/distribute.png and ch08/distillation.png, which were dropped in #499 because the `dist*` .gitignore rule matched them; narrow the rule to `/dist/`. - Fix the English toc blocks: chapter entries now point at real files and the root toc has part headings, so section pages are built again (previously only chapter index pages were generated). - Add tests/test_image_references.py to CI to catch missing or unrenderable figure references. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
50 lines
1.4 KiB
YAML
50 lines
1.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
test:
|
|
name: Tests
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.10'
|
|
|
|
- name: Setup mdBook
|
|
uses: peaceiris/actions-mdbook@v2
|
|
with:
|
|
mdbook-version: 'latest'
|
|
|
|
- name: Run mdBook regression tests
|
|
run: |
|
|
python3 -m unittest discover -s tests -p 'test_prepare_mdbook.py'
|
|
python3 -m unittest discover -s tests -p 'test_prepare_mdbook_zh.py'
|
|
python3 -m unittest discover -s tests -p 'test_assemble_docs_publish_tree.py'
|
|
python3 -m unittest discover -s tests -p 'test_ensure_book_resources.py'
|
|
python3 -m unittest discover -s tests -p 'test_image_references.py'
|
|
python3 -m unittest discover -s tests -p 'test_update_docs_workflow.py'
|
|
|
|
- name: Build v2 (EN + ZH) with mdBook
|
|
run: bash build_mdbook_v2.sh
|
|
|
|
- name: Build v1 (EN + ZH) with mdBook
|
|
run: bash build_mdbook_v1.sh
|
|
|
|
- name: Verify build outputs
|
|
run: |
|
|
for d in .mdbook-v2/book .mdbook-v2-zh/book .mdbook-v1/book .mdbook-v1-zh/book; do
|
|
if [ ! -f "$d/index.html" ]; then
|
|
echo "ERROR: $d/index.html not found"
|
|
exit 1
|
|
fi
|
|
echo "OK: $d/index.html exists"
|
|
done
|