mirror of
https://github.com/openmlsys/openmlsys-zh.git
synced 2026-04-01 01:41:17 +08:00
Move the English root site to mdBook, keep the Chinese site as a sub-book, and update CI/deploy to publish .mdbook outputs to docs/ and docs/cn/. Also add regression coverage for placeholder skipping, publish-tree assembly, and shared resource setup.
69 lines
1.8 KiB
YAML
69 lines
1.8 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-en:
|
|
name: Build (English mdBook)
|
|
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: Install Rust toolchain
|
|
run: |
|
|
curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
|
|
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: Install mdBook
|
|
run: cargo install mdbook --locked
|
|
|
|
- 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_mdbook_mathjax.py'
|
|
|
|
- name: Build English HTML with mdBook
|
|
run: bash build_mdbook.sh
|
|
|
|
build-zh:
|
|
name: Build (Chinese mdBook)
|
|
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: Install Rust toolchain
|
|
run: |
|
|
curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
|
|
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: Install mdBook
|
|
run: cargo install mdbook --locked
|
|
|
|
- name: Build Chinese HTML with mdBook
|
|
run: bash build_mdbook_zh.sh
|
|
|
|
build:
|
|
name: build
|
|
needs: [build-en, build-zh]
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- run: echo "All builds passed"
|