Skip to content

Commit

Permalink
New CI for Doxygen
Browse files Browse the repository at this point in the history
Let's hope it works alright.
  • Loading branch information
darksylinc committed Nov 10, 2023
1 parent 1ffbd3a commit 73ac8ad
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux.build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Linux CI

# Controls when the action will run.
on:
Expand Down
36 changes: 4 additions & 32 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
name: CI
name: Doxygen

# Controls when the action will run.
on:
push:
branches: 'master'

# Run for all pull requests
pull_request:
branches: '*'
types: [opened]

env:
CMAKE_DOXYGEN_INPUT_LIST: "Components Docs/src OgreMain PlugIns RenderSystems"
OGRE_SOURCE_DIR: "./"
OGRE_BINARY_DIR: "./"
OGRE_VERSION: "latest"
DOXYGEN_HTML_OUTPUT_DIR: "./latest"

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand All @@ -24,27 +15,8 @@ jobs:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v3

- name: Generate Doxyfile
# Replace CMake's ${ENV_VAR} to Doxygen's $(ENV_VAR) syntax
run: cat CMake/Templates/html.cfg.in | sed 's/\${\(.*\)}/$(\1)/' > Doxyfile

- name: Generate docs with doxygen
uses: mattnotmitt/doxygen-action@v1
with:
doxyfile-path: './Doxyfile'

- name: Remove files
working-directory: .github/workflows/
run: python3 doxygen_remove_files.py

- name: Publish # Only on master branch
if: github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./
keep_files: true
- name: Build Doxygen
working-directory: ./
run: ./Scripts/BuildScripts/build_ci_doxygen.sh
47 changes: 47 additions & 0 deletions Scripts/BuildScripts/build_ci_doxygen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash

if [ -z "$OGRE_VERSION" ]; then
echo "OGRE_VERSION is not set. Aborting!"
exit 1;
fi

echo "--- Installing System Dependencies ---"
sudo apt-get update
sudo apt-get install -y ninja-build libxrandr-dev libxaw7-dev libxcb-randr0-dev libx11-xcb-dev libsdl2-dev doxygen graphviz

echo "--- Fetching prebuilt Dependencies ---"
wget https://github.com/OGRECave/ogre-next-deps/releases/download/bin-releases/Dependencies_Release_Ubuntu.20.04.LTS.Clang-12_a3f61e782f3effbd58a15727885cbd85cd1b342b.7z

echo "--- Extracting prebuilt Dependencies ---"
7z x Dependencies_Release_Ubuntu.20.04.LTS.Clang-12_a3f61e782f3effbd58a15727885cbd85cd1b342b.7z

mkdir -p build/Doxygen
cd build/Doxygen
echo "--- Building Ogre (Debug) ---"
cmake \
-DOGRE_CONFIG_THREAD_PROVIDER=0 \
-DOGRE_CONFIG_THREADS=0 \
-DOGRE_BUILD_COMPONENT_SCENE_FORMAT=1 \
-DOGRE_BUILD_SAMPLES2=0 \
-DOGRE_BUILD_TESTS=0 \
-DOGRE_BUILD_COMPONENT_PLANAR_REFLECTIONS=1 \
-DCMAKE_BUILD_TYPE="Debug" \
-DCMAKE_CXX_STANDARD=11 \
-G Ninja ../.. || exit $?
ninja OgreDoc || exit $?
cd ../.. || exit $?
git checkout gh-pages || exit $?
cd api || exit $?
echo "--- Removing old ${OGRE_VERSION} ---"
git rm -rf ${OGRE_VERSION} || exit $?
rm -rf ${OGRE_VERSION} || exit $?
echo "--- Copying new ${OGRE_VERSION} ---"
mv ../build/Doxygen/api/html ${OGRE_VERSION} || exit $?
echo "--- Adding to ${OGRE_VERSION} to git ---"
git add ${OGRE_VERSION} || exit $?
echo "--- Committing ---"
git commit -m "Deploy GH" || exit $?
echo "--- Pushing repo... ---"
git push || exit $?

echo "Done!"

0 comments on commit 73ac8ad

Please sign in to comment.