Dev stage for documentation actions (#85) #48
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: Documentation | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
doxygen: | |
runs-on: windows-2019 | |
strategy: | |
max-parallel: 0 | |
matrix: | |
python-version: [3.8] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/checkout@v2 | |
with: # for github push action | |
#persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token | |
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | |
- name: Install windows documentation requirements | |
run: | | |
$url = "https://www.doxygen.nl/files/doxygen-1.9.5.windows.x64.bin.zip" | |
Invoke-WebRequest -Uri $url -OutFile "C:\doxygen.zip" | |
Extract-7Zip -Path "C:\doxygen.zip" -DestinationPath "C:\windows\system32" | |
doxygen --version` | |
choco install graphviz -y | |
#sudo apt-get install -y doxygen | |
#sudo apt-get install -y graphviz | |
- name: Build c++ documentation with doxygen | |
run: | | |
cd src | |
doxygen Doxyfile | |
ls | |
- name: Build c# documentation with doxygen | |
run: | | |
doxygen Doxyfile_Csharp | |
doxygen Doxyfile_Public_CSharp | |
- name: Auto-deploy doc changes | |
run : | | |
git config --local user.email "[email protected]" | |
git config --local user.name "github-actions[bot]" | |
mkdir html_build | |
git worktree add -B docs html_build origin/docs | |
# cp -a docs/. html_build/ | |
robocopy .\docs\ .\html_build\ /e | |
cd html_build | |
git add . | |
git commit -m "ghpages" | |
git push -f | |
sphinx: | |
runs-on: windows-2019 | |
needs: doxygen | |
strategy: | |
max-parallel: 0 | |
matrix: | |
python-version: [3.8] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/checkout@v2 | |
with: # for github push action | |
#persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token | |
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 pytest | |
- name: Install from pypi | |
run: | | |
pip install matplotlib | |
pip install numpy | |
pip install scipy | |
pip install dhart | |
python -c "from dhart.spatialstructures import Graph" | |
- name: Install documentation dependencies | |
run: | | |
pip install sphinx numpydoc matplotlib | |
- name: Setup cmake | |
run: | | |
ls | |
cd src | |
cmake ./src/ -G"Visual Studio 16 2019" -DCMAKE_GENERATOR_PLATFORM="x64" -DCMAKE_INSTALL_PREFIX=".\..\build\Python" -DDHARTAPI_Config="All" -DDHARTAPI_EnableTests="False" -DCMAKE_CONFIGURATION_TYPES="Release" -DDHARTAPI_EnablePython="True" -DDHARTAPI_EnableCSharp="False" -DINSTALL_GTEST="False" ".\" 2>&1 | |
- name: cmake build | |
run: | | |
ls | |
cd src | |
cmake --build . --config Release | |
- name: cmake Install | |
run: | | |
ls | |
cd src | |
cmake --install . | |
# - name: check Existing dhart | |
# run: | | |
# python -c "from dhart.spatialstructures import Graph" | |
# - name: Install package | |
# run: | | |
# ls | |
# cd build/Python | |
# ls | |
# pip install . | |
# - name: test if package dll is installed | |
# run: | | |
# ls | |
# cd build/Python | |
# ls | |
# cd bin | |
# ls | |
# python -c "import dhart" | |
# ls | |
# python -c "from dhart.spatialstructures import Graph" | |
# - name: Install Sphinx Latex | |
# run: | | |
# sudo apt-get update -y && sudo apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended | |
- name: Build documentation with sphinx | |
run: | | |
cd "docs/Python Docs" | |
ls | |
./make.bat clean | |
./make.bat html | |
# make latexpdf | |
cd build | |
ls | |
cd html | |
ls | |
- name: Auto-deploy python doc changes | |
run : | | |
git config --local user.email "[email protected]" | |
git config --local user.name "github-actions[bot]" | |
mkdir html_build | |
git worktree add -B docs html_build origin/docs | |
robocopy .\docs\ .\html_build\ /e | |
cd html_build | |
git add . | |
git commit -m "ghpages" | |
git push -f | |