Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#112: Add documentation #118

Merged
merged 13 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build Documentation

on:
push:
branches:
- master

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install packages
run: |
sudo apt-get update -y
sudo apt-get install -y git doxygen

- name: Python Setup
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install jinja2
pip install pygments

- name: Generate documentation
id: run_doxygen
run: |
./build-docs.sh ${{ secrets.DOCS_TOKEN }}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
DARMA Toolkit v. 1.5.0
DARMA/vt-tv => Virtual Transport -- Task Visualizer

Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC
Copyright 2019-2024 National Technology & Engineering Solutions of Sandia, LLC
(NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
Government retains certain rights in this software.

Expand Down
2 changes: 1 addition & 1 deletion apps/vt-tv_standalone.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// example2.cc
// DARMA/vt-tv => Virtual Transport -- Task Visualizer
//
// Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC
// Copyright 2019-2024 National Technology & Engineering Solutions of Sandia, LLC
// (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
// Government retains certain rights in this software.
//
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/tv.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// tv.h
// DARMA/vt-tv => Virtual Transport -- Task Visualizer
//
// Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC
// Copyright 2019-2024 National Technology & Engineering Solutions of Sandia, LLC
// (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
// Government retains certain rights in this software.
//
Expand Down
86 changes: 86 additions & 0 deletions build-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#!/bin/bash

# Arguments
TOKEN=${1:-}

# Git information
GIT_BRANCH="master"
GIT_REPO_DOCS=DARMA-tasking.github.io
GIT_OUTPUT_FOLDER=vt_tv_docs

# Locale variables
CURRENT_DIR="$(dirname -- "$(realpath -- "$0")")" # Current directory
BUILD_DIR=${CURRENT_DIR}/build
GHPAGE=${BUILD_DIR}/${GIT_REPO_DOCS}
MCSS=${BUILD_DIR}/m.css

# Set env vars
export DOXYGEN_EXECUTABLE=$(which doxygen)
export DOXYGEN_CONFIG_IN=${CURRENT_DIR}/docs/Doxyfile.in
export DOXYGEN_CONFIG_OUT=${BUILD_DIR}/Doxyfile
export DOXYGEN_PROJECT_NAME="VT TV"
export DOXYGEN_INPUT_DIR=${CURRENT_DIR}/src/
export DOXYGEN_DOCS_DIR=${CURRENT_DIR}/docs/
export DOXYGEN_EXAMPLE_DIR=${CURRENT_DIR}/examples/
export DOXYGEN_MAIN_PAGE=${CURRENT_DIR}/docs/md/mainpage.md
export DOXYGEN_OUTPUT_DIR=${BUILD_DIR}/${GIT_OUTPUT_FOLDER}/
export VERSION_MAJOR="1"
export VERSION_MINOR="5"
export VERSION_PATCH="0"

# Create buid dir
mkdir -p ${BUILD_DIR}

# Copy Doxygen configuration files
cp ${DOXYGEN_CONFIG_IN} ${DOXYGEN_CONFIG_OUT}
cp ${DOXYGEN_CONFIG_IN}-mcss ${DOXYGEN_CONFIG_OUT}-mcss

# Replace by env variables
env | grep -E 'DOXYGEN|VERSION_|PROJECT_SOURCE_DIR|PROJECT_BINARY_DIR' | while IFS= read -r line; do
value=${line#*=}
name=${line%%=*}
valueEscape=$( echo $value | sed 's/\//\\\//g' )

# Replace @VARIBALE_NAME@ by is value
sed -i "s/@${name}@/${valueEscape}/" ${DOXYGEN_CONFIG_OUT}
done

# Go to build folder
cd ./build

# Launch Doxygen generation
${DOXYGEN_EXECUTABLE} ${DOXYGEN_CONFIG_OUT}

# GIT Clone m.css
git clone https://github.com/mosra/m.css

# GIT Checkout m.css on master
cd m.css
git checkout master
cd ../

# GIT Clone documentation repository
git clone --depth=1 "https://${TOKEN}@github.com/DARMA-tasking/${GIT_REPO_DOCS}"

# Copy into the documentation repository and go to the into the repository
cd "$GHPAGE"

# Change branch [dev]
git checkout -b "$GIT_BRANCH"

# Launch doxygen python script to apply style on generated documentation
"$MCSS/documentation/doxygen.py" ${DOXYGEN_CONFIG_OUT}-mcss

# Copy new docs into the documentation repository
mv "$DOXYGEN_OUTPUT_DIR" "$GHPAGE/$GIT_OUTPUT_FOLDER"

# GIT set user
git config --global user.email "[email protected]"
git config --global user.name "Jonathan Lifflander"

# GIT add the new folder documentation
git add "$GIT_OUTPUT_FOLDER"

# GIT Commit and push
git commit -m "Update $GIT_OUTPUT_FOLDER (auto-build)"
git push origin "$GIT_BRANCH" --force
Loading
Loading