-
Notifications
You must be signed in to change notification settings - Fork 18
120 lines (101 loc) · 4.17 KB
/
docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# 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