diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6e52f5c8..167b10d6 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -11,7 +11,7 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* -name: Documentation +name: Test and Build Docs permissions: contents: write @@ -20,24 +20,47 @@ permissions: id-token: write on: - pull_request_target: - types: [opened, reopened, synchronize] # Allows forks to trigger the docs build - push: - branches: - - main - merge_group: - types: [checks_requested] + workflow_run: + workflows: ["CPP/C++"] + types: [completed] jobs: + docs-verify: + if: ${{ github.event.workflow_run.conclusion == 'success' }} + uses: eclipse-score/cicd-workflows/.github/workflows/docs-verify.yml@c1c90b1a82a1fab0fc202979dde6686b2162d5a8 # v0.0.0 + permissions: + pull-requests: write + contents: read + with: + bazel-docs-verify-target: "--lockfile_mode=error //:docs_check" + + fetch-coverage: + if: ${{ github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-latest + steps: + - name: Download coverage artifact from coverage run + uses: actions/download-artifact@v4 + with: + name: ${{ github.event.repository.name }}_cpp_coverage + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ secrets.GITHUB_TOKEN }} + path: coverage-artifact + + - name: Re-upload coverage artifact for this workflow run + uses: actions/upload-artifact@v4 + with: + name: ${{ github.event.repository.name }}_cpp_coverage + path: coverage-artifact/ + build-docs: - uses: eclipse-score/cicd-workflows/.github/workflows/docs.yml@main + needs: fetch-coverage + uses: eclipse-score/cicd-workflows/.github/workflows/docs.yml@c1c90b1a82a1fab0fc202979dde6686b2162d5a8 # v0.0.0 permissions: contents: write pages: write pull-requests: write id-token: write - with: - # the bazel-target depends on your repo specific docs_targets configuration (e.g. "suffix") bazel-target: "--lockfile_mode=error //:docs -- --github_user=${{ github.repository_owner }} --github_repo=${{ github.event.repository.name }}" retention-days: 3 + tests-report-artifact: ${{ github.event.repository.name }}_cpp_coverage