From ebd25d4d4ac035c1122728fcf565db856dd2c61d Mon Sep 17 00:00:00 2001 From: Noam Bernstein Date: Thu, 7 Mar 2024 09:46:29 -0500 Subject: [PATCH 1/2] further attempt to fix docs generated in github CI --- .github/workflows/docs.yml | 42 +++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6776368f..1d704289 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -10,6 +10,7 @@ on: branches: - main workflow_dispatch: + pull_request: jobs: build-docs: @@ -40,7 +41,7 @@ jobs: python3 --version - name: Install dependencies from pip - run: python3 -m pip install wheel setuptools numpy scipy click matplotlib pyyaml spglib phonopy phono3py rdkit flake8 pytest pytest-cov nbsphinx ipython requests + 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: | @@ -48,6 +49,45 @@ jobs: 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 setup.py build + python3 -m pip install . + cd .. + + git clone https://github.com/phonopy/phono3py + cd phono3py + python3 setup.py build + python3 setup.py install + cd .. + - name: Install Quippy from PyPI run: python3 -m pip install quippy-ase From d6946f8df1f781d6429d5ddc38b7bd847d4de20e Mon Sep 17 00:00:00 2001 From: Noam Bernstein Date: Thu, 7 Mar 2024 09:55:43 -0500 Subject: [PATCH 2/2] Only deploy docs on push to main --- .github/workflows/docs.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1d704289..58e1f636 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -4,7 +4,8 @@ name: Build docs -# on all push actions AND can be triggered manually as well +# 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: @@ -103,6 +104,17 @@ jobs: 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: