From a2e89cc5daced0cf250d3b6768f7b27a717e9774 Mon Sep 17 00:00:00 2001 From: Andreas Heinrich Date: Thu, 28 Nov 2024 13:02:00 +0100 Subject: [PATCH 1/9] initial Signed-off-by: Andreas Heinrich --- .ci/build-kit/scripts/build_docs.sh | 31 ++++++++++++++++ .ci/build-kit/scripts/deploy_docs.sh | 0 .github/workflows/build_and_test.yaml | 53 +++++++++++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100755 .ci/build-kit/scripts/build_docs.sh create mode 100644 .ci/build-kit/scripts/deploy_docs.sh diff --git a/.ci/build-kit/scripts/build_docs.sh b/.ci/build-kit/scripts/build_docs.sh new file mode 100755 index 000000000..d48249a57 --- /dev/null +++ b/.ci/build-kit/scripts/build_docs.sh @@ -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 diff --git a/.ci/build-kit/scripts/deploy_docs.sh b/.ci/build-kit/scripts/deploy_docs.sh new file mode 100644 index 000000000..e69de29bb diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml index 4700578b9..f735d075a 100644 --- a/.github/workflows/build_and_test.yaml +++ b/.github/workflows/build_and_test.yaml @@ -32,3 +32,56 @@ jobs: ctest_report_path: ctest-report coverage_report_path: gcovr-coverage coverage_xml_path: gcovr-coverage-xml.xml + build-docs: + name: Build Doxygen Documentation + needs: + - ci + runs-on: ${{ inputs.runner || 'ubuntu-22.04' }} + steps: + - name: Checkout + uses: actions/checkout@v4.2.2 + 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-everest-core:{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/upload-artifact@v4.4.3 + with: + if-no-files-found: error + name: doxygen-docs + path: doxygen-docs + From 2ca81ed0148223b6be8b64a837e1247ea82e9a95 Mon Sep 17 00:00:00 2001 From: Andreas Heinrich Date: Thu, 28 Nov 2024 14:09:06 +0100 Subject: [PATCH 2/9] fix image name Signed-off-by: Andreas Heinrich --- .github/workflows/build_and_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml index f735d075a..bc6728f41 100644 --- a/.github/workflows/build_and_test.yaml +++ b/.github/workflows/build_and_test.yaml @@ -60,7 +60,7 @@ jobs: if len(tags) == 0: print("No tags found!❌") exit(1) - tag = f"local/build-kit-everest-core:{tags[0]}" + 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}") From 7125c4220633428c36f960ba64d366d85d9e60ae Mon Sep 17 00:00:00 2001 From: Andreas Heinrich Date: Thu, 28 Nov 2024 15:20:59 +0100 Subject: [PATCH 3/9] use ci branch Signed-off-by: Andreas Heinrich --- .github/workflows/build_and_test.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml index bc6728f41..7db498cf9 100644 --- a/.github/workflows/build_and_test.yaml +++ b/.github/workflows/build_and_test.yaml @@ -17,7 +17,7 @@ on: jobs: ci: name: Build, Lint and Test - uses: everest/everest-ci/.github/workflows/continuous_integration.yml@v1.4.4 + uses: everest/everest-ci/.github/workflows/continuous_integration.yml@feature/add-doxygen permissions: contents: read secrets: @@ -84,4 +84,3 @@ jobs: if-no-files-found: error name: doxygen-docs path: doxygen-docs - From 1f366a77c780f10965c0813bec8b22d0667a315f Mon Sep 17 00:00:00 2001 From: Andreas Heinrich Date: Thu, 28 Nov 2024 15:49:15 +0100 Subject: [PATCH 4/9] add deploy job Signed-off-by: Andreas Heinrich --- .github/workflows/build_and_test.yaml | 34 ++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml index 7db498cf9..bbdb66eeb 100644 --- a/.github/workflows/build_and_test.yaml +++ b/.github/workflows/build_and_test.yaml @@ -32,7 +32,7 @@ jobs: ctest_report_path: ctest-report coverage_report_path: gcovr-coverage coverage_xml_path: gcovr-coverage-xml.xml - build-docs: + build_docs: name: Build Doxygen Documentation needs: - ci @@ -84,3 +84,35 @@ jobs: if-no-files-found: error name: doxygen-docs path: doxygen-docs + deploy_docs: + 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 }} #LTODO + path: everest-ci + - name: Checkout + uses: actions/checkout@v4.2.2 + with: + path: source + - name: Download doxygen-docs artifact + uses: actions/download-artifact@v4.4.3 + with: + name: 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 From e12ad7590d91cfd73497bf17ebd35e2a9170c68b Mon Sep 17 00:00:00 2001 From: Andreas Heinrich Date: Thu, 28 Nov 2024 16:06:00 +0100 Subject: [PATCH 5/9] use branch build kit# Signed-off-by: Andreas Heinrich --- .github/workflows/build_and_test.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml index bbdb66eeb..dbe21f760 100644 --- a/.github/workflows/build_and_test.yaml +++ b/.github/workflows/build_and_test.yaml @@ -17,6 +17,7 @@ on: jobs: ci: name: Build, Lint and Test + #LTODO tmp uses: everest/everest-ci/.github/workflows/continuous_integration.yml@feature/add-doxygen permissions: contents: read @@ -32,6 +33,8 @@ 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 build_docs: name: Build Doxygen Documentation needs: From 44aa756267bc5457a407d18c4bb37eeb8ce7031a Mon Sep 17 00:00:00 2001 From: Andreas Heinrich Date: Thu, 28 Nov 2024 16:08:54 +0100 Subject: [PATCH 6/9] minor fix Signed-off-by: Andreas Heinrich --- .github/workflows/build_and_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml index dbe21f760..cf0dc90e5 100644 --- a/.github/workflows/build_and_test.yaml +++ b/.github/workflows/build_and_test.yaml @@ -34,7 +34,7 @@ jobs: coverage_report_path: gcovr-coverage coverage_xml_path: gcovr-coverage-xml.xml #LTODO: tmp - build_kit_base_image_tag: feature/add-doxygen + build_kit_base_image_tag: feature-add-doxygen build_docs: name: Build Doxygen Documentation needs: From 4066b5c39f87a455d33b1cc51b867acc243ee4e2 Mon Sep 17 00:00:00 2001 From: Andreas Heinrich Date: Thu, 28 Nov 2024 16:24:41 +0100 Subject: [PATCH 7/9] minor fix Signed-off-by: Andreas Heinrich --- .github/workflows/build_and_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml index cf0dc90e5..cb4c8100b 100644 --- a/.github/workflows/build_and_test.yaml +++ b/.github/workflows/build_and_test.yaml @@ -105,7 +105,7 @@ jobs: with: path: source - name: Download doxygen-docs artifact - uses: actions/download-artifact@v4.4.3 + uses: actions/download-artifact@v4 with: name: doxygen-docs - name: Deploy doxygen docs From 640fe6c365fb696c89236f0f25664f9ce78b1bd7 Mon Sep 17 00:00:00 2001 From: Andreas Heinrich Date: Thu, 28 Nov 2024 17:02:58 +0100 Subject: [PATCH 8/9] minor change Signed-off-by: Andreas Heinrich --- .github/workflows/build_and_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml index cb4c8100b..3cbbf4069 100644 --- a/.github/workflows/build_and_test.yaml +++ b/.github/workflows/build_and_test.yaml @@ -98,7 +98,7 @@ jobs: uses: actions/checkout@v4 with: repository: everest/everest-ci - ref: ${{ needs.ci.outputs.sha_everest_ci }} #LTODO + ref: ${{ needs.ci.outputs.sha_everest_ci }} path: everest-ci - name: Checkout uses: actions/checkout@v4.2.2 From d2e7244c28320afc4bab623804eaa94950631bcf Mon Sep 17 00:00:00 2001 From: Andreas Heinrich Date: Fri, 29 Nov 2024 09:55:26 +0100 Subject: [PATCH 9/9] specify path Signed-off-by: Andreas Heinrich --- .ci/build-kit/scripts/deploy_docs.sh | 0 .github/workflows/build_and_test.yaml | 1 + 2 files changed, 1 insertion(+) delete mode 100644 .ci/build-kit/scripts/deploy_docs.sh diff --git a/.ci/build-kit/scripts/deploy_docs.sh b/.ci/build-kit/scripts/deploy_docs.sh deleted file mode 100644 index e69de29bb..000000000 diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml index 3cbbf4069..1cfd33b0f 100644 --- a/.github/workflows/build_and_test.yaml +++ b/.github/workflows/build_and_test.yaml @@ -108,6 +108,7 @@ jobs: 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