-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (101 loc) · 3.64 KB
/
docs-pr.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
name: Docs
on:
pull_request:
merge_group:
jobs:
docs:
runs-on: ubuntu-latest
name: Propose Docs
defaults:
run:
shell: bash -l {0}
steps:
# fetch-depth: 0 gets git history so Psi4 version computable
- name: Checkout
if: ${{ github.repository == 'psi4/psi4' }}
uses: actions/checkout@v2
with:
fetch-depth: 0
path: code
- name: Checkout psi4/psi4docs Repo
if: ${{ github.repository == 'psi4/psi4' }}
uses: actions/checkout@v2
with:
repository: psi4/psi4docs
path: docs
ref: master
- name: Create Conda Environment
if: ${{ github.repository == 'psi4/psi4' }}
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
use-mamba: true
activate-environment: test
add-pip-as-python-dependency: true
auto-activate-base: false
channels: conda-forge
environment-file: code/devtools/conda-envs/docs-cf.yaml
show-channel-urls: true
- name: Environment Information
if: ${{ github.repository == 'psi4/psi4' }}
run: |
conda info
conda list
which conda python cmake $CXX
# This patch and the jinja2<3 restriction were needed as recently as March 2023, but when I try a py311 env with newest everything, both can be released.
#- name: Patch Sphinx for Pybind11
# if: ${{ github.repository == 'psi4/psi4' }}
# run: sed -i "s/app\.add_autodoc_attrgetter/# app.add_autodoc_attrgetter/g" ${CONDA_PREFIX}/lib/python3.10/site-packages/sphinx_automodapi/autodoc_enhancements.py
# docs are not Ninja ready
- name: Configure with CMake (Conda Gnu + MKL)
if: ${{ github.repository == 'psi4/psi4' }}
working-directory: ./code
run: |
cmake \
-S. \
-Bobjdir \
-G"Unix Makefiles" \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_COMPILER=${CC} \
-DCMAKE_CXX_COMPILER=${CXX} \
-DCMAKE_CXX_FLAGS="-O0" \
-DCMAKE_PREFIX_PATH="${CONDA_PREFIX}" \
-DCMAKE_INSIST_FIND_PACKAGE_gau2grid=ON \
-DCMAKE_INSIST_FIND_PACKAGE_Libint2=ON \
-DCMAKE_INSIST_FIND_PACKAGE_pybind11=ON \
-DCMAKE_INSIST_FIND_PACKAGE_Libxc=ON \
-DENABLE_ecpint=ON \
-DCMAKE_INSIST_FIND_PACKAGE_ecpint=ON \
-DCMAKE_INSIST_FIND_PACKAGE_optking=ON \
-DCMAKE_INSIST_FIND_PACKAGE_qcelemental=ON \
-DCMAKE_INSIST_FIND_PACKAGE_qcengine=ON \
-DSPHINXMAN_STRICT=ON \
-DSPHINX_ROOT=${CONDA_PREFIX}
- name: Compile Psi4
if: ${{ github.repository == 'psi4/psi4' }}
working-directory: ./code
run: cmake --build objdir -j`getconf _NPROCESSORS_ONLN`
- name: Compile & Pack Docs
if: ${{ github.repository == 'psi4/psi4' }}
working-directory: ./code
run: |
cmake --build objdir --target sphinxman -j`getconf _NPROCESSORS_ONLN`
cd objdir/doc/sphinxman
tar -zcf sphinxman.tar.gz html/
- name: Archive Docs Tarball
if: (success() || failure()) && ${{ github.repository == 'psi4/psi4' }}
uses: actions/upload-artifact@v2
with:
name: sphinxman-html
path: |
code/objdir/doc/sphinxman/sphinxman.tar.gz
retention-days: 7
- name: Compare Docs (PR generated vs psi4/psi4docs)
if: ${{ github.repository == 'psi4/psi4' }}
working-directory: ./docs
id: compare-psi4docs
run: |
cp -pR ../code/objdir/doc/sphinxman/html .
echo "::group::Selective Git Diff"
git diff --color-words -I"Last updated on" -I"psi4/tree"
echo "::endgroup::"