Merge pull request #1302 from DLR-AMR/feature-more_const #3
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: "Upload newest documentation to website" | |
# This file is part of t8code. | |
# t8code is a C library to manage a collection (a forest) of multiple | |
# connected adaptive space-trees of general element types in parallel. | |
# | |
# Copyright (C) 2015 the developers | |
# | |
# t8code is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or | |
# (at your option) any later version. | |
# | |
# t8code is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
# GNU General Public License for more details. | |
# | |
# You should have received a copy of the GNU General Public License | |
# along with t8code; if not, write to the Free Software Foundation, Inc., | |
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
# | |
# This github CI script runs on every push or merged pr on the main branch. | |
# It generates the doxygen documentation of the main branch and uploads it | |
# to the t8code website | |
# | |
on: | |
push: | |
branches: | |
- main | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
update_dev_doc: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 10 | |
steps: | |
# | |
# Setup and bootstrap | |
# | |
- uses: actions/checkout@v4 | |
with: | |
fetch-tags: true # required to get version tags | |
fetch-depth: 0 # required to get all history, especially the version tags | |
- name: Update packages | |
run: sudo apt-get update && sudo apt-get upgrade -y | |
# This step is necessary to get the newest package data | |
- name: Install zlib | |
run: sudo apt-get install libz-dev | |
- name: Install doxygen | |
run: sudo apt-get install doxygen-latex | |
- name: init submodules | |
run: git submodule init | |
- name: update submodules | |
run: git submodule update | |
- name: bootstrap | |
run: ./bootstrap | |
# build config vars | |
- name: build CFLAGS and CXXFLAGS variables | |
run: echo CFLAGS_var="-Wall -pedantic -O3" >> $GITHUB_ENV | |
&& echo CXXFLAGS_var="-Wall -pedantic -O3" >> $GITHUB_ENV | |
- name: build config variables | |
run: export CONFIG_OPTIONS="--without-blas ${LESS_TEST_OPTION}" | |
&& export CONFIG_SERIAL_DEBUG="$CONFIG_OPTIONS --enable-debug --with-sc=$SC_SERIAL_DEBUG/install --with-p4est=$P4EST_SERIAL_DEBUG/install" | |
- name: Check vars | |
run: echo "[$CONFIG_SERIAL_DEBUG]" | |
# configure and generate doxygen | |
- name: check debugging mode | |
run: echo "Checking debug mode" | |
- name: configure | |
run: mkdir build_debug && cd build_debug && ../configure $CONFIG_SERIAL_DEBUG CFLAGS="$CFLAGS_var" CXXFLAGS="$CXXFLAGS_var" | |
- name: make doxygen | |
run: cd build_debug && make doxygen | |
# upload documentation | |
- name: Checkout t8code-website repo | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
repository: DLR-AMR/t8code-website | |
path: t8code-website | |
token: ${{ secrets.T8DDY_TOKEN }} | |
- name: Add documentation to website | |
run: | | |
cd t8code-website/content | |
rm -rf doc/dev/* | |
mkdir -p doc/dev | |
cp -r ../../build_debug/doc/html/* doc/dev/ | |
- name: check_diff | |
run: | | |
cd t8code-website | |
if [ ! -z "$(git status --porcelain --untracked-files=no )" ]; then echo "COMMIT_NEW_DOC=true" >> $GITHUB_ENV; fi | |
- name: Commit and push files | |
if: ${{ env.COMMIT_NEW_DOC == 'true' }} | |
run: | | |
cd t8code-website | |
git config --local user.email "t8ddy.bot@gmail.com" | |
git config --local user.name "t8ddy" | |
git add content/doc/dev/ | |
git commit -m "Add newest documentation" | |
git push --force-with-lease | |