summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorlvntky <klevent1903@gmail.com>2024-11-26 11:59:19 +0300
committerlvntky <klevent1903@gmail.com>2024-11-26 11:59:19 +0300
commit06064d75eb74c621df0f0ce0e6ced8ed352e2112 (patch)
tree9ed0151173ca29fd1999cfbe5d931634c73f9e10 /.github
parent3f7f21f3c238497ee783858b34cc457c5a949ce2 (diff)
[docs] updated actions
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/doxygen.yml222
1 files changed, 91 insertions, 131 deletions
diff --git a/.github/workflows/doxygen.yml b/.github/workflows/doxygen.yml
index 22896a0..7cddae9 100644
--- a/.github/workflows/doxygen.yml
+++ b/.github/workflows/doxygen.yml
@@ -1,139 +1,99 @@
-name: Generate and Deploy Doxygen Documentation
+name: Generate and Deploy Documentation
+
on:
push:
- branches:
- - master
+ branches: [ master ]
pull_request:
- branches:
- - master
+ branches: [ master ]
+ workflow_dispatch: # Allow manual triggering
+
+permissions:
+ contents: read
+ pages: write
+ id-token: write
jobs:
- build-and-deploy:
+ generate-docs:
runs-on: ubuntu-latest
steps:
- # Checkout the repository
- - name: Checkout repository
- uses: actions/checkout@v4
- with:
- fetch-depth: 0
-
- # Install dependencies
- - name: Install dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y doxygen graphviz python3-pip
-
- # Clone m.css and set up Python
- - name: Set up m.css
- run: |
- git clone --depth 1 https://github.com/mosra/m.css.git
- pip install pillow matplotlib
-
- # List contents to debug
- - name: Debug m.css directory
- run: |
- echo "Listing m.css contents:"
- find mcss -type f | grep -E "\.css$"
-
- # Prepare documentation configuration
- - name: Prepare Doxygen configuration
- run: |
- mkdir -p docs
- # Use Python to generate the CSS
- python3 mcss/documentation/css.py dark documentation
-
- # Generate Doxygen configuration file
- - name: Generate Doxyfile
- run: |
- cat > docs/Doxyfile << EOL
- # General configuration
- PROJECT_NAME = fbgl
- PROJECT_NUMBER = 0.1.0
- PROJECT_BRIEF = "Documentation for the fbgl library"
- OUTPUT_DIRECTORY = docs
- CREATE_SUBDIRS = YES
- OPTIMIZE_OUTPUT_FOR_C = YES
- GENERATE_HTML = YES
- GENERATE_LATEX = NO
- GENERATE_MAN = NO
- GENERATE_RTF = NO
- GENERATE_XML = NO
-
- # Input sources
- INPUT = fbgl.h README.md
- FILE_PATTERNS = *.h README.md
- RECURSIVE = NO
- EXCLUDE_PATTERNS = test/*
-
- # Markdown support
- USE_MDFILE_AS_MAINPAGE = README.md
- MARKDOWN_SUPPORT = YES
-
- # Extract documentation
- EXTRACT_ALL = YES
- EXTRACT_PRIVATE = NO
- EXTRACT_STATIC = YES
- EXTRACT_LOCAL_CLASSES = YES
- EXTRACT_LOCAL_METHODS = YES
-
- # Source browsing
- SOURCE_BROWSER = YES
- INLINE_SOURCES = YES
- REFERENCED_BY_RELATION = YES
- REFERENCES_RELATION = YES
-
- # Documentation styling for m.css
- HTML_OUTPUT = html
- HTML_EXTRA_STYLESHEET = "\
- m.css/output/m-dark.compiled.css \
- m.css/output/m-documentation.compiled.css"
- HTML_DYNAMIC_SECTIONS = YES
- GENERATE_TREEVIEW = YES
-
- # Search functionality
- SEARCHENGINE = YES
- SERVER_BASED_SEARCH = NO
- EXTERNAL_SEARCH = NO
- SEARCHDATA_FILE = searchdata.xml
-
- # Warnings
- WARNINGS = YES
- WARN_IF_UNDOCUMENTED = YES
- WARN_NO_PARAMDOC = YES
- WARN_FORMAT = "\$file:\$line: \$text"
-
- # Extra configurations
- ALIASES = "note=\par\textbf{Note:}"
- ALIASES += "todo=\par\textbf{TODO:}"
- ALIASES += "bug=\par\textbf{Bug:}"
- EXCLUDE_SYMBOLS = "*Test*"
-
- # Graph and diagram support
- HAVE_DOT = YES
- DOT_GRAPH_MAX_NODES = 50
- DOT_TRANSPARENT = YES
- DOT_IMAGE_FORMAT = svg
- CALL_GRAPH = YES
- CALLER_GRAPH = YES
- CLASS_DIAGRAMS = YES
- DOT_MULTI_TARGETS = YES
- EOL
-
- # Generate Doxygen documentation
- - name: Generate Doxygen documentation
- run: |
- # Ensure output directory exists
- mkdir -p m.css/output
- # Generate CSS using m.css Python script
- python3 mcss/documentation/css.py dark documentation
- # Run Doxygen
- doxygen docs/Doxyfile
-
- # Deploy to GitHub Pages
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ submodules: recursive
+
+ - name: Set up Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.9'
+
+ - name: Install system dependencies
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y doxygen graphviz
+
+ - name: Install Python dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install jinja2 Pygments
+
+ - name: Clone m.css
+ run: |
+ git clone https://github.com/mosra/m.css.git
+
+ - name: Generate Doxyfile
+ run: |
+ doxygen -g Doxyfile
+
+ - name: Customize Doxyfile
+ run: |
+ # Project details
+ sed -i 's/PROJECT_NAME = "My Project"/PROJECT_NAME = "FBGL"/' Doxyfile
+ sed -i 's/PROJECT_BRIEF = /PROJECT_BRIEF = "Fast and Lightweight Framebuffer Graphics Library"/' Doxyfile
+
+ # Output and input configuration
+ sed -i 's/OUTPUT_DIRECTORY = /OUTPUT_DIRECTORY = docs/' Doxyfile
+ sed -i 's/INPUT = /INPUT = fbgl.h README.md/' Doxyfile
+ sed -i 's/RECURSIVE = NO/RECURSIVE = YES/' Doxyfile
+
+ # Documentation generation options
+ sed -i 's/GENERATE_HTML = NO/GENERATE_HTML = YES/' Doxyfile
+ sed -i 's/HAVE_DOT = NO/HAVE_DOT = YES/' Doxyfile
+ sed -i 's/DOT_IMAGE_FORMAT = png/DOT_IMAGE_FORMAT = svg/' Doxyfile
+
+ # m.css and additional configurations
+ echo "HTML_EXTRA_STYLESHEET = m.css/css/m-dark.compiled.css m.css/css/m-documentation.compiled.css" >> Doxyfile
+ echo "GENERATE_LATEX = NO" >> Doxyfile
+ echo "INTERACTIVE_SVG = YES" >> Doxyfile
+ echo "EXTRACT_ALL = YES" >> Doxyfile
+ echo "EXTRACT_PRIVATE = NO" >> Doxyfile
+ echo "CASE_SENSE_NAMES = NO" >> Doxyfile
+ echo "SEARCHENGINE = YES" >> Doxyfile
+ echo "USE_MDFILE_AS_MAINPAGE = README.md" >> Doxyfile
+ echo "MARKDOWN_SUPPORT = YES" >> Doxyfile
+
+ - name: Generate Documentation with Doxygen
+ run: |
+ doxygen Doxyfile
+
+ - name: Process Documentation with m.css
+ run: |
+ python m.css/documentation/doxygen.py Doxyfile
+
+ - name: Setup GitHub Pages
+ uses: actions/configure-pages@v3
+
+ - name: Upload Documentation Artifact
+ uses: actions/upload-pages-artifact@v2
+ with:
+ path: './docs/html'
+
+ deploy:
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
+ runs-on: ubuntu-latest
+ needs: generate-docs
+ steps:
- name: Deploy to GitHub Pages
- uses: peaceiris/actions-gh-pages@v3
- with:
- github_token: ${{ secrets.GITHUB_TOKEN }}
- publish_dir: docs/html
- force_orphan: true
- full_commit_message: Update documentation \ No newline at end of file
+ id: deployment
+ uses: actions/deploy-pages@v2 \ No newline at end of file