Skip to content

Commit

Permalink
Doc: Style and build flow alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
vovamarch committed Nov 9, 2023
1 parent 7663cc0 commit eae9fe7
Show file tree
Hide file tree
Showing 14 changed files with 101 additions and 421 deletions.
16 changes: 0 additions & 16 deletions .github/doxygen.json

This file was deleted.

18 changes: 0 additions & 18 deletions .github/linkchecker.json

This file was deleted.

118 changes: 13 additions & 105 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,125 +1,33 @@
name: Build Doxygen Documentation
name: Build documentation

on:
workflow_dispatch:
pull_request:
push:
branches: [main]
release:
types: [published]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
DOXYGEN_VERSION: 1.9.6
DOXYGEN_URL: 'https://sourceforge.net/projects/doxygen/files/rel-{VERSION}/doxygen-{VERSION}.linux.bin.tar.gz/download'

jobs:
documentation:
Build documentation:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install packages
shell: bash
run: |
sudo apt-get update
sudo pip install LinkChecker
- name: Cache Doxygen ${{ env.DOXYGEN_VERSION }}
id: cache-doxygen
uses: actions/cache@v3
with:
path: /opt/doxygen-${{ env.DOXYGEN_VERSION }}
key: doxygen-${{ env.DOXYGEN_VERSION }}-${{ runner.os }}

- name: Download Doxygen ${{ env.DOXYGEN_VERSION }}
if: steps.cache-doxygen.outputs.cache-hit != 'true'
shell: bash
run: |
wget -O doxygen.tgz $(sed -e 's/{VERSION}/${{ env.DOXYGEN_VERSION }}/g' <<< ${{ env.DOXYGEN_URL }})
sudo tar -C /opt -xf doxygen.tgz
- name: Install Doxygen ${{ env.DOXYGEN_VERSION }}
if: env.DOXYGEN_VERSION != 'none'
shell: bash
run: |
sudo ln -s /opt/doxygen-${{ env.DOXYGEN_VERSION }}/bin/doxygen /usr/local/bin/
which doxygen
doxygen --version
- name: Generate doxygen
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
echo "::add-matcher::.github/doxygen.json"
./Documentation/Doxygen/gen_doc.sh
echo "::remove-matcher owner=doxygen::"
- name: Run linkchecker
shell: bash
- name: Fetch tags
if: github.event_name == 'release'
run: |
echo "::add-matcher::.github/linkchecker.json"
./Documentation/Doxygen/check_links.sh
echo "::remove-matcher owner=linkchecker::"
git fetch --tags --force
- name: Archive documentation
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v3
- uses: Open-CMSIS-Pack/gen-pack-action@main
with:
name: documentation
path: ./Documentation/html/
retention-days: 1
if-no-files-found: error

- name: Archive documentation
if: (github.event_name == 'release' || github.event_name == 'push' || github.event_name == 'workflow_dispatch')
shell: bash
run: |
tar -cvjf /tmp/doc.tbz2 -C ./Documentation/html/ .
- uses: actions/checkout@v3
if: (github.event_name == 'release' || github.event_name == 'push' || github.event_name == 'workflow_dispatch')
with:
ref: gh-pages

- name: Publish documentation
if: (github.event_name == 'release' || github.event_name == 'push' || github.event_name == 'workflow_dispatch')
shell: bash
run: |
rm -rf ${GITHUB_REF_NAME}
mkdir -p ${GITHUB_REF_NAME}
tar -xvjf /tmp/doc.tbz2 -C ${GITHUB_REF_NAME}
if ${{ github.event_name == 'release' }}; then
rm -f latest
ln -s ${GITHUB_REF_NAME} latest
MSG="release"
else
MSG="branch"
fi
.github/update_versions.sh
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Update documentation for ${MSG} ${GITHUB_REF_NAME}"
git push
- uses: actions/checkout@v3
if: (github.event_name == 'release' || github.event_name == 'push' || github.event_name == 'workflow_dispatch')
with:
ref: ${{ github.ref }}

- name: Trigger GH-Pages deployment
if: (github.event_name == 'release' || github.event_name == 'push' || github.event_name == 'workflow_dispatch')
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
gh workflow run gh-pages.yml --ref gh-pages
if [ $? -ne 0 ]; then
echo "::notice::Failed to trigger GH-Pages deployment via workflow 'gh-pages.yml'!"
fi
doxygen-version: 1.9.6
gen-doc-script: ./Documentation/Doxygen/gen_doc.sh
doc-path: ./Documentation/html
gh-pages-branch: gh-pages
6 changes: 3 additions & 3 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v2
with:
# Upload entire repository
path: '.'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v2
52 changes: 0 additions & 52 deletions Documentation/Doxygen/check_links.sh

This file was deleted.

8 changes: 4 additions & 4 deletions Documentation/Doxygen/dap.dxy.in
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ FILE_VERSION_FILTER =
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
# tag is left empty.

LAYOUT_FILE = ./style_template/Layout_forUser.xml
LAYOUT_FILE = ./style_template/layout.xml

# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
# the reference definitions. This must be a list of .bib files. The .bib
Expand Down Expand Up @@ -921,7 +921,7 @@ INPUT = ./src/mainpage.md \
./src/dap_firmware.md \
./src/dap_drv_install.md \
./src/dap_validate.md \
./src/Ref_dap.txt \
./src/ref_dap.txt \
../../Firmware/Template \
../../Firmware/Config

Expand Down Expand Up @@ -1393,7 +1393,7 @@ HTML_EXTRA_STYLESHEET = ./style_template/extra_stylesheet.css \
HTML_EXTRA_FILES = ./style_template/tabs.css \
./style_template/version.css \
./style_template/tab_b.png \
./style_template/printComponentTabs.js \
./style_template/tabs.js \
./style_template/darkmode_toggle.js \
./style_template/navtree.js \
./style_template/dropdown.png
Expand Down Expand Up @@ -1738,7 +1738,7 @@ ENUM_VALUES_PER_LINE = 1
# Minimum value: 0, maximum value: 1500, default value: 250.
# This tag requires that the tag GENERATE_HTML is set to YES.

TREEVIEW_WIDTH = 250
TREEVIEW_WIDTH = 320

# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
# external symbols imported via tag files in a separate window.
Expand Down
Loading

0 comments on commit eae9fe7

Please sign in to comment.