-
Notifications
You must be signed in to change notification settings - Fork 0
168 lines (149 loc) · 4.68 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: Latest Docs
on:
push:
branches:
- master
- gha-docs
- '1.*.x'
concurrency:
group: latest-docs-group
cancel-in-progress: true
permissions:
contents: read
jobs:
docs:
strategy:
matrix:
cfg:
- runs-on: ubuntu-latest
python-version: "3.10"
name: Latest Docs
runs-on: ${{ matrix.cfg.runs-on }}
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 website repo
if: ${{ github.repository == 'psi4/psi4' }}
uses: actions/checkout@v2
with:
repository: psi4/psi4docs
path: docs
ref: master
persist-credentials: true
token: ${{ secrets.psi4docs_from_psi4 }}
- name: Write Conda environment files
run: |
echo "::group::Prepare OS Python"
which python
python --version
pip install PyYAML
echo "::endgroup::"
#
code/conda/psi4-path-advisor.py \
env \
--name p4docs \
--python ${{ matrix.cfg.python-version }} \
--disable addons \
--offline-conda
#
echo "::group::View Env Spec File for Conda"
printf "\n<<< env_p4docs.yaml >>>\n"
pygmentize -g -O style=friendly,linenos=1 env_p4docs.yaml
echo "::endgroup::"
- name: Create Conda Environment
if: ${{ github.repository == 'psi4/psi4' }}
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
use-mamba: true
activate-environment: p4docs
add-pip-as-python-dependency: true
auto-activate-base: false
channels: conda-forge
environment-file: env_p4docs.yaml
show-channel-urls: true
- name: Environment Information
if: ${{ github.repository == 'psi4/psi4' }}
run: |
conda info
conda list
which conda python cmake $CXX
# docs are finally Ninja ready
- name: Configure with CMake (Conda Gnu + MKL)
if: ${{ github.repository == 'psi4/psi4' }}
working-directory: ./code
run: |
conda/psi4-path-advisor.py \
cache \
--objdir objdir \
--insist
echo "::group::View Cache File for CMake"
printf "\n<<< cache_p4docs@objdir.cmake >>>\n"
pygmentize -g -O style=colorful,linenos=1 cache_p4docs@objdir.cmake
echo "::endgroup::"
#
cmake \
-S. \
-B objdir \
-G Ninja \
-C ${{ github.workspace }}/code/cache_p4docs@objdir.cmake \
-D CMAKE_BUILD_TYPE=Debug \
-D CMAKE_CXX_FLAGS="-O0" \
-D SPHINXMAN_STRICT=ON
- name: Compile Psi4
if: ${{ github.repository == 'psi4/psi4' }}
working-directory: ./code
run: cmake --build objdir
- name: Compile & Pack Docs
if: ${{ github.repository == 'psi4/psi4' }}
working-directory: ./code
run: |
cmake --build objdir --target sphinxman
cd objdir/doc/sphinxman
tar -zcf sphinxman.tar.gz html/
- name: Archive Docs Tarball
if: ${{ github.repository == 'psi4/psi4' }}
uses: actions/upload-artifact@v2
with:
name: sphinxman-html
path: |
code/objdir/doc/sphinxman/sphinxman.tar.gz
retention-days: 1
- name: Compile & Pack Doxygen
if: ${{ github.repository == 'psi4/psi4' }}
working-directory: ./code
run: |
cmake --build objdir --target doxyman
cd objdir/doc/doxygen
tar -zcf doxyman.tar.gz html/
- name: Compare Docs (generated vs psi4/psi4docs)
if: github.event_name == 'push' && github.repository == 'psi4/psi4'
working-directory: ./docs/sphinxman
id: compare-psi4docs
run: |
cp -pR ../../code/objdir/doc/sphinxman/html .
rm -rf ${{ github.ref_name }}
mv html ${{ github.ref_name }}
echo "::group::Selective Git Diff"
git diff --color-words -I"Last updated on" -I"psi4/tree" -I"documentation_options"
echo "::endgroup::"
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -A
git commit -m "auto-generated from Psi4 ${{ github.ref_name }}"
- name: Push Changes to psi4/psi4docs
if: github.repository == 'psi4/psi4'
uses: ad-m/github-push-action@master
with:
directory: ./docs
repository: psi4/psi4docs
github_token: ${{ secrets.psi4docs_from_psi4 }}
force: true