From 21e7379bb5d1b996999d9a99dddf5b8dd7a614cf Mon Sep 17 00:00:00 2001 From: "Matias N. Goldberg" Date: Fri, 10 Nov 2023 19:11:25 -0300 Subject: [PATCH] New CI for Doxygen Let's hope it works alright. --- .github/workflows/main.yml | 34 ++--------------- Scripts/BuildScripts/build_ci_doxygen.sh | 47 ++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 31 deletions(-) create mode 100755 Scripts/BuildScripts/build_ci_doxygen.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3dce0ae315a..3230954d9f6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,17 +5,8 @@ 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: @@ -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 diff --git a/Scripts/BuildScripts/build_ci_doxygen.sh b/Scripts/BuildScripts/build_ci_doxygen.sh new file mode 100755 index 00000000000..e6fb5d234ce --- /dev/null +++ b/Scripts/BuildScripts/build_ci_doxygen.sh @@ -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 + +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!"