Fix compilation error for C++20 (#3061) #21
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
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: | |
runs-on: ubuntu-latest | |
name: Latest 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 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: 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: ${{ 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 . | |
mv html ${{ github.ref_name }} | |
echo "::group::Selective Git Diff" | |
git diff --color-words -I"Last updated on" -I"psi4/tree" | |
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 | |