mirror of
https://github.com/openmlsys/openmlsys-zh.git
synced 2026-03-24 22:11:05 +08:00
* docs: split the book into English and Chinese builds * feat: update english version framework * fix: fix ci
79 lines
2.0 KiB
YAML
79 lines
2.0 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-en:
|
|
name: Build (English)
|
|
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'
|
|
cache: 'pip'
|
|
|
|
- name: Install pandoc
|
|
run: |
|
|
wget -q https://github.com/jgm/pandoc/releases/download/2.19.2/pandoc-2.19.2-1-amd64.deb
|
|
sudo dpkg -i pandoc-2.19.2-1-amd64.deb
|
|
|
|
- name: Install d2lbook
|
|
run: |
|
|
git clone https://github.com/openmlsys/d2l-book.git
|
|
cd d2l-book
|
|
# Fix Python 3.10+ incompatibility: bibtex<2.0.0 depends on oset which
|
|
# uses collections.MutableSet removed in Python 3.10.
|
|
sed -i "s/'sphinxcontrib-bibtex<2.0.0'/'sphinxcontrib-bibtex>=2.5.0'/" setup.py
|
|
python3 -m pip install .
|
|
|
|
- name: Install Python dependencies
|
|
run: python3 -m pip install -r requirements.txt
|
|
|
|
- name: Build English HTML
|
|
run: bash build_html.sh
|
|
|
|
build-zh:
|
|
name: Build (Chinese)
|
|
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'
|
|
cache: 'pip'
|
|
|
|
- name: Install pandoc
|
|
run: |
|
|
wget -q https://github.com/jgm/pandoc/releases/download/2.19.2/pandoc-2.19.2-1-amd64.deb
|
|
sudo dpkg -i pandoc-2.19.2-1-amd64.deb
|
|
|
|
- name: Install d2lbook
|
|
run: |
|
|
git clone https://github.com/openmlsys/d2l-book.git
|
|
cd d2l-book
|
|
sed -i "s/'sphinxcontrib-bibtex<2.0.0'/'sphinxcontrib-bibtex>=2.5.0'/" setup.py
|
|
python3 -m pip install .
|
|
|
|
- name: Install Python dependencies
|
|
run: python3 -m pip install -r requirements.txt
|
|
|
|
- name: Build Chinese HTML
|
|
run: bash build_html_zh.sh
|
|
|
|
build:
|
|
name: build
|
|
needs: [build-en, build-zh]
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- run: echo "All builds passed"
|