Build docs #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
# This is testing the python versions *other than* the | |
# one in the QUIP Docker, which is 3.7.10 at the time | |
# of writing this. Coverage is disabled. | |
name: Build docs | |
# on push to main, manual trigger, and pull request. | |
# See below for depdendent deploy job that only runs if event is push | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
pull_request: | |
jobs: | |
build-docs: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ "3.9" ] | |
max-parallel: 5 | |
env: | |
coverage-on-version: "3.9" | |
use-mpi: True | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up python ${{ matrix.python-version }} via conda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
- name: Check python version | |
run: | | |
which python3 | |
python3 --version | |
- name: Install dependencies from pip | |
run: python3 -m pip install wheel setuptools numpy scipy click matplotlib pyyaml spglib rdkit flake8 pytest pytest-cov requests nbsphinx ipython | |
- name: Install latest ASE from gitlab | |
run: | | |
python3 -m pip install git+https://gitlab.com/ase/ase.git | |
echo -n "ASE VERSION " | |
python3 -c "import ase; print(ase.__file__, ase.__version__)" | |
- name: Install intel-oneapi-mkl for phono3py | |
run: | | |
# based on | |
# https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-download.html?operatingsystem=linux&distributions=aptpackagemanager | |
# download the key to system keyring | |
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null | |
# add signed entry to apt sources and configure the APT client to use Intel repository: | |
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list | |
sudo apt update | |
sudo apt install intel-oneapi-mkl | |
sudo apt install intel-oneapi-mkl-devel | |
- name: Install phono3py from source | |
run: | | |
# find mklvars | |
for pkg in $( apt list --installed | fgrep "installed" | fgrep "mkl" | sed "s#/.*##" ); do | |
if dpkg -L $pkg | egrep -q 'vars.sh$'; then | |
mklvars=$( dpkg -L $pkg | egrep 'vars.sh$' ) | |
break | |
fi | |
done | |
if [ -z $mklvars ]; then | |
echo 'Failed to find *vars.sh in any pkg named *mkl*' | |
exit 1 | |
fi | |
source $mklvars intel64 | |
git clone https://github.com/phonopy/phonopy | |
cd phonopy | |
python3 -m pip install -e . | |
cd .. | |
git clone https://github.com/phonopy/phono3py | |
cd phono3py | |
python3 -m pip install -e . | |
cd .. | |
- name: Install Quippy from PyPI | |
run: python3 -m pip install quippy-ase | |
- name: Install wfl (expyre and universalSOAP are dependencies) | |
run: python3 -m pip install . | |
- name: Install pandoc | |
run: sudo apt-get install pandoc | |
- name: Build documentation | |
run: | | |
python3 -m pip install sphinx sphinx-book-theme docutils==0.16 sphinx-click myst-parser | |
python3 -m pip install --upgrade jinja2 | |
cd docs | |
make html | |
# event type from https://stackoverflow.com/questions/61886993/in-github-actions-how-to-get-the-type-of-a-trigger-event-as-a-variable | |
# conditional control ("if:") from https://docs.github.com/en/actions/using-jobs/using-conditions-to-control-job-execution | |
# dependency from https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow | |
deploy-docs: | |
if: github.event.action == 'push' | |
needs: build-docs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy documentation | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: docs/build/html |