Merge pull request #5744 from nzw0301/update-actions/upload-artifact #268
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sphinx | |
on: | |
push: | |
branches: | |
- master | |
pull_request: {} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
documentation: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# TODO(c-bata): Use the newer Python version | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
# note (crcrpar): We've not updated tutorial frequently enough so far thus | |
# it'd be okay to discard cache by any small changes including typo fix under tutorial directory. | |
- name: Sphinx Gallery Cache | |
uses: actions/cache@v3 | |
env: | |
cache-name: sphx-glry-documentation | |
with: | |
path: | | |
tutorial/MNIST | |
docs/source/tutorial | |
key: py3.8-${{ env.cache-name }}-${{ hashFiles('tutorial/**/*') }} | |
- name: Install Dependencies | |
run: | | |
sudo apt-get install optipng | |
python -m pip install -U pip | |
pip install --progress-bar off -U .[document] --extra-index-url https://download.pytorch.org/whl/cpu | |
- name: Output installed packages | |
run: | | |
pip freeze --all | |
- name: Output dependency tree | |
run: | | |
pip install pipdeptree | |
pipdeptree | |
- name: Build Document | |
run: | | |
cd docs | |
make html | |
cd ../ | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: built-html | |
path: | | |
docs/build/html | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: tutorial | |
path: | | |
docs/source/tutorial | |
doctest: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# TODO(c-bata): Use the newer Python version | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: Sphinx Gallery Cache | |
uses: actions/cache@v3 | |
env: | |
cache-name: sphx-glry-doctest | |
with: | |
path: | | |
tutorial/MNIST | |
docs/source/tutorial | |
key: py3.8-${{ env.cache-name }}-${{ hashFiles('tutorial/**/*') }} | |
- name: Install Dependencies | |
run: | | |
sudo apt-get install optipng | |
python -m pip install -U pip | |
pip install --progress-bar off -U .[document] --extra-index-url https://download.pytorch.org/whl/cpu | |
- name: Output installed packages | |
run: | | |
pip freeze --all | |
- name: Output dependency tree | |
run: | | |
pip install pipdeptree | |
pipdeptree | |
- name: Run Doctest | |
run: | | |
cd docs | |
make doctest |