Skip to content

Commit

Permalink
Optimized doc GHAs
Browse files Browse the repository at this point in the history
Optimize doc GHA by caching doxygen 1.11 and removing steps/file generation.
  • Loading branch information
andressbarajas committed Nov 14, 2024
1 parent 7b5c44c commit 4a4a347
Show file tree
Hide file tree
Showing 3 changed files with 2,711 additions and 25 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/gen-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,22 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Doxygen
run: sudo apt install -y wget graphviz

- name: Cache Doxygen 1.11.0
uses: actions/cache@v4
id: cache-doxygen
with:
path: ./doxygen-1.11.0
key: doxygen-1.11.0-${{ runner.os }}

- name: Install Doxygen 1.11.0
run: |
wget https://github.com/doxygen/doxygen/releases/download/Release_1_11_0/doxygen-1.11.0.linux.bin.tar.gz
tar -xzf doxygen-1.11.0.linux.bin.tar.gz
sudo mv doxygen-1.11.0/bin/* /usr/local/bin/
rm -rf doxygen-1.11.0*
if [ ! -f doxygen-1.11.0/bin/doxygen ]; then
sudo apt install -y wget
wget https://github.com/doxygen/doxygen/releases/download/Release_1_11_0/doxygen-1.11.0.linux.bin.tar.gz
tar -xzf doxygen-1.11.0.linux.bin.tar.gz
rm doxygen-1.11.0.linux.bin.tar.gz
fi
sudo cp doxygen-1.11.0/bin/* /usr/local/bin/
- name: Create Output Directory for Doxygen
run: mkdir -p doc/reference
Expand Down
40 changes: 22 additions & 18 deletions .github/workflows/pr-docs-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ on:
- 'include/**'
- 'kernel/arch/dreamcast/include/**'
- 'addons/include/**'
- 'doc/Doxyfile'
- 'doc/pages/**'
- 'doc/**'
- 'README.md'

jobs:
Expand All @@ -23,31 +22,36 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Doxygen
run: sudo apt install -y wget graphviz

- name: Cache Doxygen 1.11.0
uses: actions/cache@v4
id: cache-doxygen
with:
path: ./doxygen-1.11.0
key: doxygen-1.11.0-${{ runner.os }}

- name: Install Doxygen 1.11.0
run: |
wget https://github.com/doxygen/doxygen/releases/download/Release_1_11_0/doxygen-1.11.0.linux.bin.tar.gz
tar -xzf doxygen-1.11.0.linux.bin.tar.gz
sudo mv doxygen-1.11.0/bin/* /usr/local/bin/
rm -rf doxygen-1.11.0*
- name: Create Output Directory for Doxygen
run: mkdir -p doc/reference

- name: Generate Documentation
run: doxygen doc/Doxyfile
if [ ! -f doxygen-1.11.0/bin/doxygen ]; then
sudo apt install -y wget
wget https://github.com/doxygen/doxygen/releases/download/Release_1_11_0/doxygen-1.11.0.linux.bin.tar.gz
tar -xzf doxygen-1.11.0.linux.bin.tar.gz
rm doxygen-1.11.0.linux.bin.tar.gz
fi
sudo cp doxygen-1.11.0/bin/* /usr/local/bin/
- name: Generate Doxygen Documentation and Display Warnings Only
run: |
# Run Doxygen and redirect all output to a temporary log
doxygen doc/Doxyfile > doxygen_output.log 2>&1
doxygen doc/DoxyfileCheck > doxygen_output.log 2>&1
# Count the warnings and store the count in a variable
warning_count=$(grep -c "warning:" doxygen_output.log)
# Extract only warnings and display them if any are found
if grep -q "warning:" doxygen_output.log; then
if [ "$warning_count" -gt 1 ]; then
echo "Doxygen generated warnings:"
grep "warning:" doxygen_output.log
exit 1
else
echo "Doxygen documentation generated without warnings."
echo "Doxygen documentation generated succesfully."
fi
Loading

0 comments on commit 4a4a347

Please sign in to comment.