From 29d9cc2ffa981a8735073484a9c29a26cd357f85 Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Wed, 26 Feb 2020 23:06:37 +0300 Subject: [PATCH] [SYCL] Enable Doxygen doc generation for GitHub Pages (#1168) Signed-off-by: Alexander Batashev --- .github/workflows/gh_pages.yml | 43 ++++++++++++++++++++++++++++++++++ buildbot/configure.py | 6 +++++ 2 files changed, 49 insertions(+) create mode 100644 .github/workflows/gh_pages.yml diff --git a/.github/workflows/gh_pages.yml b/.github/workflows/gh_pages.yml new file mode 100644 index 0000000000000..c6cd43458919e --- /dev/null +++ b/.github/workflows/gh_pages.yml @@ -0,0 +1,43 @@ +name: Generate Doxygen documentation + +on: + schedule: + - cron: 0 1 * * * + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + ref: sycl + path: repo + - uses: actions/checkout@v2 + with: + repository: intel/llvm-docs + path: docs + - name: Install deps + run: sudo apt-get install -y doxygen graphviz ssh + - name: Build Docs + run: | + mkdir -p $GITHUB_WORKSPACE/build + cd $GITHUB_WORKSPACE/build + python $GITHUB_WORKSPACE/repo/buildbot/configure.py -w $GITHUB_WORKSPACE \ + -s $GITHUB_WORKSPACE/repo -o $GITHUB_WORKSPACE/build -t Release --docs + cmake --build . --target doxygen-sycl + - name: Deploy + env: + SSH_KEY: ${{secrets.ACTIONS_DEPLOY_KEY}} + run: | + mkdir -p ~/.ssh + echo "$SSH_KEY" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + eval "$(ssh-agent -s)" + ssh-add -k ~/.ssh/id_rsa + cd $GITHUB_WORKSPACE/docs + yes | \cp -rf $GITHUB_WORKSPACE/build/tools/sycl/doc/doxygen/html/* . + git config --global user.name "iclsrc" + git config --global user.email "ia.compiler.tools.git@intel.com" + git add . + git diff-index --quiet HEAD || git commit -m "Update docs" -s + git push diff --git a/buildbot/configure.py b/buildbot/configure.py index 9bb1d26ad52f1..c0e4dc3eb6d31 100644 --- a/buildbot/configure.py +++ b/buildbot/configure.py @@ -17,6 +17,7 @@ def do_configure(args): libclc_targets_to_build = '' sycl_build_pi_cuda = 'OFF' llvm_enable_assertions = 'ON' + llvm_enable_doxygen = 'OFF' if platform.system() == 'Linux': icd_loader_lib = os.path.join(icd_loader_lib, "libOpenCL.so") @@ -32,6 +33,9 @@ def do_configure(args): if args.assertions: llvm_enable_assertions = 'ON' + if args.docs: + llvm_enable_doxygen = 'ON' + install_dir = os.path.join(args.obj_dir, "install") cmake_cmd = [ @@ -52,6 +56,7 @@ def do_configure(args): "-DSYCL_ENABLE_WERROR=ON", "-DCMAKE_INSTALL_PREFIX={}".format(install_dir), "-DSYCL_INCLUDE_TESTS=ON", # Explicitly include all kinds of SYCL tests. + "-DLLVM_ENABLE_DOXYGEN={}".format(llvm_enable_doxygen), llvm_dir ] @@ -84,6 +89,7 @@ def main(): metavar="BUILD_TYPE", required=True, help="build type, debug or release") parser.add_argument("--cuda", action='store_true', help="switch from OpenCL to CUDA") parser.add_argument("--assertions", action='store_true', help="build with assertions") + parser.add_argument("--docs", action='store_true', help="build Doxygen documentation") args = parser.parse_args()