Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy Doxygen Docs #888

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .ci/build-kit/scripts/build_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

cmake \
-B "$EXT_MOUNT/build" \
-S "$EXT_MOUNT/source" \
-G Ninja \
-DBUILD_TESTING=ON \
-DLIBOCPP16_BUILD_EXAMPLES=ON \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX="$EXT_MOUNT/dist" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON

retVal=$?
if [ $retVal -ne 0 ]; then
echo "Configuring failed with return code $retVal"
exit $retVal
fi

ninja -C "$EXT_MOUNT/build" doxygen-ocpp
retVal=$?
if [ $retVal -ne 0 ]; then
echo "Building docs failed with return code $retVal"
exit $retVal
fi

cp -r "$EXT_MOUNT/build/dist/docs/html" "$EXT_MOUNT/doxygen-docs"
retVal=$?
if [ $retVal -ne 0 ]; then
echo "Copying docs failed with return code $retVal"
exit $retVal
fi
90 changes: 89 additions & 1 deletion .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ on:
jobs:
ci:
name: Build, Lint and Test
uses: everest/everest-ci/.github/workflows/[email protected]
#LTODO tmp
uses: everest/everest-ci/.github/workflows/continuous_integration.yml@feature/add-doxygen
Comment on lines +20 to +21
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#LTODO tmp
uses: everest/everest-ci/.github/workflows/continuous_integration.yml@feature/add-doxygen
uses: everest/everest-ci/.github/workflows/[email protected]

permissions:
contents: read
secrets:
Expand All @@ -32,3 +33,90 @@ jobs:
ctest_report_path: ctest-report
coverage_report_path: gcovr-coverage
coverage_xml_path: gcovr-coverage-xml.xml
#LTODO: tmp
build_kit_base_image_tag: feature-add-doxygen
Comment on lines +36 to +37
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#LTODO: tmp
build_kit_base_image_tag: feature-add-doxygen

build_docs:
name: Build Doxygen Documentation
needs:
- ci
runs-on: ${{ inputs.runner || 'ubuntu-22.04' }}
steps:
- name: Checkout
uses: actions/[email protected]
with:
path: source
- name: Setup run scripts
run: |
mkdir scripts
rsync -a source/.ci/build-kit/scripts/ scripts
- name: Docker Meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.BUILD_KIT_IMAGE_NAME }}
- name: Set output tag
id: buildkit_tag
shell: python3 {0}
run: |
import os
tags = "${{ steps.meta.outputs.tags }}".split(",")
if len(tags) == 0:
print("No tags found!❌")
exit(1)
tag = f"local/build-kit-libocpp:{tags[0]}"
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
f.write(f"tag={tag}\n")
print(f"Set tag={tag}")
- name: Download build-kit image
uses: actions/download-artifact@v4
with:
name: build-kit
- name: Load build-kit image
run: |
docker load -i build-kit.tar
docker image tag ${{ steps.buildkit_tag.outputs.tag }} build-kit
- name: Build Doxygen Documentation
run: |
docker run \
--volume "${{ github.workspace }}:/ext" \
--name build-doc-container \
build-kit run-script build_docs
- name: Upload Doxygen Documentation
uses: actions/[email protected]
with:
if-no-files-found: error
name: doxygen-docs
path: doxygen-docs
deploy_docs:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
deploy_docs:
deploy_docs:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}

name: Deploy Doxygen Documentation
needs:
- ci
- build_docs
runs-on: ${{ inputs.runner || 'ubuntu-22.04' }}
steps:
- name: Checkout local github actions
uses: actions/checkout@v4
with:
repository: everest/everest-ci
ref: ${{ needs.ci.outputs.sha_everest_ci }}
path: everest-ci
- name: Checkout
uses: actions/[email protected]
with:
path: source
- name: Download doxygen-docs artifact
uses: actions/download-artifact@v4
with:
name: doxygen-docs
path: doxygen-docs
- name: Deploy doxygen docs
id: deploy_doxygen_docs
uses: ./everest-ci/github-actions/deploy-doxygen-docs
with:
target_repo: EVerest/everest.github.io
github_token : ${{ secrets.SA_GITHUB_PAT }}
docs_directory: doxygen-docs
- name: Write summary
run: |
echo "Doxygen documentation deployed successfully!🚀" >> $GITHUB_STEP_SUMMARY
echo "You can access the documentation at: https://everest.github.io/${{ steps.deploy_doxygen_docs.outputs.deployed_path}}" >> $GITHUB_STEP_SUMMARY