ci: doc-publish: Publish API coverage docs only when available

The API coverage documentation support was (relatively) recently introduced
in bad87f1684 and is not available in older
release branches.

Since doc-publish workflows always run in the default (main) branch
context, it is necessary to make the API coverage documentation handling
optional for the workflow runs that are triggered from older release
branches.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit is contained in:
Stephanos Ioannidis 2024-03-02 10:59:01 +09:00 committed by Chris Friedt
parent b14f7d00ca
commit 1493271cf7
2 changed files with 14 additions and 6 deletions

View file

@ -46,7 +46,9 @@ jobs:
- name: Uncompress HTML docs - name: Uncompress HTML docs
run: | run: |
tar xf html-output/html-output.tar.xz -C html-output tar xf html-output/html-output.tar.xz -C html-output
tar xf api-coverage/api-coverage.tar.xz -C api-coverage if [ -f api-coverage/api-coverage.tar.xz ]; then
tar xf api-coverage/api-coverage.tar.xz -C api-coverage
fi
- name: Configure AWS Credentials - name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2 uses: aws-actions/configure-aws-credentials@v2
@ -62,6 +64,8 @@ jobs:
aws s3 sync --quiet html-output/html \ aws s3 sync --quiet html-output/html \
s3://builds.zephyrproject.org/${{ github.event.repository.name }}/pr/${PR_NUM}/docs \ s3://builds.zephyrproject.org/${{ github.event.repository.name }}/pr/${PR_NUM}/docs \
--delete --delete
aws s3 sync --quiet api-coverage/coverage-report/ \ if [ -d api-coverage/coverage-report ]; then
s3://builds.zephyrproject.org/${{ github.event.repository.name }}/pr/${PR_NUM}/api-coverage \ aws s3 sync --quiet api-coverage/coverage-report/ \
--delete s3://builds.zephyrproject.org/${{ github.event.repository.name }}/pr/${PR_NUM}/api-coverage \
--delete
fi

View file

@ -32,7 +32,9 @@ jobs:
- name: Uncompress HTML docs - name: Uncompress HTML docs
run: | run: |
tar xf html-output/html-output.tar.xz -C html-output tar xf html-output/html-output.tar.xz -C html-output
tar xf api-coverage/api-coverage.tar.xz -C api-coverage if [ -f api-coverage/api-coverage.tar.xz ]; then
tar xf api-coverage/api-coverage.tar.xz -C api-coverage
fi
- name: Configure AWS Credentials - name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2 uses: aws-actions/configure-aws-credentials@v2
@ -53,5 +55,7 @@ jobs:
aws s3 sync --quiet html-output/html s3://docs.zephyrproject.org/${VERSION} --delete aws s3 sync --quiet html-output/html s3://docs.zephyrproject.org/${VERSION} --delete
aws s3 sync --quiet html-output/html/doxygen/html s3://docs.zephyrproject.org/apidoc/${VERSION} --delete aws s3 sync --quiet html-output/html/doxygen/html s3://docs.zephyrproject.org/apidoc/${VERSION} --delete
aws s3 sync --quiet api-coverage/coverage-report/ s3://docs.zephyrproject.org/api-coverage/${VERSION} --delete if [ -d api-coverage/coverage-report ]; then
aws s3 sync --quiet api-coverage/coverage-report/ s3://docs.zephyrproject.org/api-coverage/${VERSION} --delete
fi
aws s3 cp --quiet pdf-output/zephyr.pdf s3://docs.zephyrproject.org/${VERSION}/zephyr.pdf aws s3 cp --quiet pdf-output/zephyr.pdf s3://docs.zephyrproject.org/${VERSION}/zephyr.pdf