diff --git a/.github/workflows/ci-cn.yml b/.github/workflows/ci-cn.yml new file mode 100644 index 0000000..dc4d80a --- /dev/null +++ b/.github/workflows/ci-cn.yml @@ -0,0 +1,56 @@ +name: Build HTML [using jupyter-book] and CN environment +on: [pull_request] +jobs: + preview: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Anaconda + uses: conda-incubator/setup-miniconda@v3 + with: + auto-update-conda: true + auto-activate-base: true + miniconda-version: 'latest' + python-version: "3.12" + environment-file: environment-cn.yml + activate-environment: quantecon + - name: Graphics Support + run: | + sudo apt-get -qq update && sudo apt-get install -y graphviz + - name: Install latex dependencies + run: | + sudo apt-get -qq update + sudo apt-get install -y \ + texlive-latex-recommended \ + texlive-latex-extra \ + texlive-fonts-recommended \ + texlive-fonts-extra \ + texlive-xetex \ + latexmk \ + xindy \ + dvipng \ + cm-super + - name: Display Conda Environment Versions + shell: bash -l {0} + run: conda list + - name: Display Pip Versions + shell: bash -l {0} + run: pip list + - name: Download "build" folder (cache) + uses: dawidd6/action-download-artifact@v7 + with: + workflow: cache.yml + branch: main + name: build-cache + path: _build + - name: Build HTML + shell: bash -l {0} + run: | + jb build lectures --path-output ./ -nW --keep-going + - name: Upload Execution Reports (HTML) + uses: actions/upload-artifact@v4 + if: failure() + with: + name: execution-reports + path: _build/html/reports diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml new file mode 100644 index 0000000..56076c5 --- /dev/null +++ b/.github/workflows/ci-windows.yml @@ -0,0 +1,33 @@ +name: HTML Build on Windows +on: [pull_request] +jobs: + preview: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Anaconda + uses: conda-incubator/setup-miniconda@v3 + with: + auto-update-conda: true + auto-activate-base: true + miniconda-version: 'latest' + python-version: "3.12" + environment-file: environment.yml + activate-environment: quantecon + - name: Display Conda Environment Versions + shell: bash -l {0} + run: conda list + - name: Display Pip Versions + shell: bash -l {0} + run: pip list + - name: Build HTML + shell: bash -l {0} + run: | + jb build lectures --path-output ./ -nW --keep-going + - name: Upload Execution Reports (HTML) + uses: actions/upload-artifact@v4 + if: failure() + with: + name: execution-reports + path: _build/html/reports diff --git a/environment-cn.yml b/environment-cn.yml index e1701d5..bcfc800 100644 --- a/environment-cn.yml +++ b/environment-cn.yml @@ -7,15 +7,14 @@ dependencies: - anaconda=2024.10 - pip - pip: - - jupyter-book==0.15.1 - - docutils==0.17.1 - - quantecon-book-theme==0.7.2 + - jupyter-book==1.0.3 + - quantecon-book-theme==0.7.6 - sphinx-tojupyter==0.3.0 - sphinxext-rediraffe==0.2.7 - - sphinx-exercise==0.4.1 + - sphinx_reredirects==0.1.4 + - sphinx-exercise==1.0.1 - sphinx-proof==0.2.0 - ghp-import==1.1.0 - - sphinxcontrib-youtube==1.1.0 - - sphinx-togglebutton==0.3.1 - - sphinx_reredirects==0.1.3 + - sphinxcontrib-youtube==1.3.0 #Version 1.3.0 is required as quantecon-book-theme is only compatible with sphinx<=5 + - sphinx-togglebutton==0.3.2 - --index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple diff --git a/environment.yml b/environment.yml index 59eeff9..05c26d5 100644 --- a/environment.yml +++ b/environment.yml @@ -1,21 +1,19 @@ name: quantecon channels: - default - - conda-forge dependencies: - python=3.12 - anaconda=2024.10 - pip - pip: - - jupyter-book==0.15.1 - - docutils==0.17.1 - - quantecon-book-theme==0.7.2 + - jupyter-book==1.0.3 + - quantecon-book-theme==0.7.6 - sphinx-tojupyter==0.3.0 - sphinxext-rediraffe==0.2.7 - - sphinx-exercise==0.4.1 + - sphinx-reredirects==0.1.4 + - sphinx-exercise==1.0.1 - sphinx-proof==0.2.0 - ghp-import==1.1.0 - - sphinxcontrib-youtube==1.1.0 - - sphinx-togglebutton==0.3.1 - - sphinx_reredirects==0.1.3 + - sphinxcontrib-youtube==1.3.0 #Version 1.3.0 is required as quantecon-book-theme is only compatible with sphinx<=5 + - sphinx-togglebutton==0.3.2