Skip to content

Commit

Permalink
Merge pull request #4 from Az-r-ow/docs-automation
Browse files Browse the repository at this point in the history
Docs automation
  • Loading branch information
Az-r-ow authored Feb 28, 2024
2 parents 4b11e7c + ed16a61 commit 5256be0
Show file tree
Hide file tree
Showing 211 changed files with 3,687 additions and 15,850 deletions.
101 changes: 97 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ on:
pull_request:
branches: [main]

env:
BUILD_DIR: build
SCRIPTS_DIR: scripts
DOCS_DIR: docs
CPP_DOCS_DIR: docs/cppdocs
PY_DOCS_DIR: docs/pydocs/html
BUILD_ARTIFACTS_ID: build-artifacts
CPP_DOCS_ARTIFACTS_ID: cpp-docs
PY_DOCS_ARTIFACTS_ID: py-docs

jobs:
build_and_test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Initialize Submodules
run: git submodule init
Expand All @@ -20,7 +29,91 @@ jobs:
run: git submodule update

- name: Build
run: source ./scripts/build_without_bindings.sh
run: source ${{ env.SCRIPTS_DIR }}/build.sh

- name: Test
run: source ./scripts/tests.sh
run: source ${{ env.SCRIPTS_DIR }}/tests.sh

- name: Archive build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.BUILD_ARTIFACTS_ID }}
path: ${{ env.BUILD_DIR }}/*.so
if_no_files_found: error
retention-days: 1/*.so

build_and_upload_cpp_docs:
needs: build_and_test
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build Cpp docs with Doxygen
uses: mattnotmitt/doxygen-action@edge
with:
working-directory: ${{ env.DOCS_DIR }}
doxyfile-path: ./Doxyfile

- name: Upload Cpp docs
uses: actions/upload-artifact@v4
with:
name: ${{ env.CPP_DOCS_ARTIFACTS_ID }}
path: ${{ env.CPP_DOCS_DIR }}
if_no_files_found: error
retention-days: 1

build_and_upload_py_docs:
needs: build_and_test
if: github.event_name == 'push'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: ${{ env.BUILD_ARTIFACTS_ID }}

- uses: actions/setup-python@v5
with:
python-version: "3.10"
- run: |
cd ${{ env.DOCS_DIR }} && \
python setup.py
- name: Build Py docs with Sphinx
run: |
cd ${{ env.DOCS_DIR }} && \
make html
- name: Navigate to root directory
run: cd ..

- name: Upload Py docs
uses: actions/upload-artifact@v4
with:
name: ${{ env.PY_DOCS_ARTIFACTS_ID }}
path: ${{ env.PY_DOCS_DIR }}
if_no_files_found: error
retention-days: 1

pages_deployment:
needs: [build_and_upload_cpp_docs, build_and_upload_py_docs]
if: github.event_name == 'push'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Download Cpp docs
uses: actions/download-artifact@v4
with:
pattern: "*-docs"

- name: Deploy Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ env.DOCS_DIR }}
10 changes: 4 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
### IDE ###
.vscode

### build ###
/build
/*build*
/docs/cppdocs/
/docs/pydocs/

### macos ###
.DS_Store
Expand All @@ -13,7 +14,4 @@ __pycache__
dataset/

### binaries ###
*.bin

### doxygen ###
Doxyfile
*.bin
Loading

0 comments on commit 5256be0

Please sign in to comment.