Unverified Commit 0bb2765a authored by Christine Kim's avatar Christine Kim Committed by GitHub
Browse files

Docs workflow (#557)

* Docs workflow (#549)

* Test docs build

* Retry

* Add brackets

* Add conda install doxygen and doxygen command

* Output some logging

* Move doxygen command inside docs dir

* Fix ls typo

* Build docs for all linux

* Add back cd docs

* Test windows

* Try python3.11

* Conditional build docs

* Build docs on 3.11

* Test S3 connection

* Setup Hugo

* Add permissions

* Add condition to build docs when merging

* Add no-sign-request bool

* Replace aws ls with sync

* Try removing no-sign-request for sync

* Add back no-sign-request with existing ale folder in s3

* Try changing aws-region

* Change region back to west-2 and test only ls

* Upload to asc-docs instead of asc-public-docs

* Test selective build and docs upload

* Use sphinx-build cmd

* Revert and upload only html folder

* Full test run

* Set docs push condition to last two steps

* Change branch to main

* Update docs setup

* Update make.bat configs

* Turn off docs build for windows

* OCAP compliance

* Revert file structure

* Just in case windows too

* Fix sphinx doc folder path

* Remove public/.doctrees
parent 99d0ff0f
Loading
Loading
Loading
Loading
+49 −0
Original line number Diff line number Diff line
name: aws-doc-deploy

on:
  workflow_run:
    workflows: ["Pull-Request-CI"]
    branches: [main]
    types: 
      - completed

jobs:
  deploy:
    if: ${{ github.event.workflow_run.conclusion == 'success' }}
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash -el {0}
    steps:
      - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
        with:
          submodules: true
          fetch-depth: 0
      - uses: conda-incubator/setup-miniconda@3b0f2504dd76ef23b6d31f291f4913fb60ab5ff3
        with:
          miniconda-version: "latest"
          activate-environment: ale
          environment-file: doc_environment.yml
          auto-activate-base: false
          auto-update-conda: true

      - name: Check doc build environment
        run: |
          conda list

      - name: Build Docs
        run: |
          cd docs
          doxygen Doxyfile.in
          sphinx-build -b html . public
            
      - name: Set AWS credentials for upload
        uses: aws-actions/configure-aws-credentials@0e613a0980cbf65ed5b322eb7a1e075d28913a83
        with:
          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          aws-region: us-west-2
      
      - name: Upload to S3
        working-directory: docs
        run: aws s3 sync --delete public s3://asc-docs/ale
+29 −3
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ jobs:
        run: |
          mkdir -p build
          cd build
          cmake -DCMAKE_BUILD_TYPE=RELEASE -DCOVERAGE=ON ..
          cmake -DCMAKE_BUILD_TYPE=RELEASE -DCOVERAGE=ON -DALE_BUILD_DOCS=OFF ..
          cmake --build .
      - name: Test C++ Package
        run: |
@@ -58,6 +58,32 @@ jobs:
          verbose: true
        if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9'

  Build-Docs:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash -el {0}
    steps:
      - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
        with:
          submodules: true
          fetch-depth: 0
      - uses: conda-incubator/setup-miniconda@3b0f2504dd76ef23b6d31f291f4913fb60ab5ff3
        with:
          miniconda-version: "latest"
          activate-environment: ale
          environment-file: doc_environment.yml
          auto-activate-base: false
          auto-update-conda: true
      - name: Check doc build environment
        run: |
          conda list
      - name: Build Docs
        run: |
          cd docs
          doxygen Doxyfile.in
          sphinx-build -b html . public

  Build-and-Test-Win:
    runs-on: windows-2019
    strategy:
@@ -82,7 +108,7 @@ jobs:
        run: |
          mkdir -p build
          cd build
          cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON -G "Visual Studio 16 2019" -A x64 -DALE_BUILD_TESTS=OFF ..
          cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON -G "Visual Studio 16 2019" -A x64 -DALE_BUILD_TESTS=OFF -DALE_BUILD_DOCS=OFF ..
          cmake --build . --target ALL_BUILD --config Release
          ls D:\a\ale\ale\build\Release
      - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
+11 −0
Original line number Diff line number Diff line
@@ -9,6 +9,10 @@
cmake_minimum_required(VERSION 3.15)
project(ale VERSION 0.9.0 DESCRIPTION "Abstraction Library for Ephemerides ")

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

message(STATUS "CMake Module Path: " ${CMAKE_MODULE_PATH})

# include what we need
include(GNUInstallDirs)

@@ -131,3 +135,10 @@ install(TARGETS ale
install(EXPORT aleTargets
        NAMESPACE ale::
        DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})

option (ALE_BUILD_DOCS "Build the ALE Docs" ON)
if(ALE_BUILD_DOCS)
  add_subdirectory ("docs")
else()
  message(STATUS "Skipping Docs")
endif()
 No newline at end of file

cmake/FindSphinx.cmake

0 → 100644
+11 −0
Original line number Diff line number Diff line
#Look for an executable called sphinx-build
find_program(SPHINX_EXECUTABLE
             NAMES sphinx-build
             DOC "Path to sphinx-build executable")

include(FindPackageHandleStandardArgs)

#Handle standard arguments to find_package like REQUIRED and QUIET
find_package_handle_standard_args(Sphinx
                                  "Failed to find sphinx-build executable"
                                  SPHINX_EXECUTABLE)

doc_environment.yml

0 → 100644
+10 −0
Original line number Diff line number Diff line
name: ale
channels:
  - conda-forge
  - default

dependencies:
  - breathe
  - cmake>=3.12
  - doxygen
  - nlohmann_json
 No newline at end of file
Loading