Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
walkowif committed Jun 26, 2024
1 parent 6a01bce commit 90f3e0a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/build-check-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,11 @@ on:
default: false
unit-test-report-directory:
description: |
Directory name on gh-pages branch where the unit test report should be uploaded.
For any additional unit test report directories to be retained by the pkgdown workflow
in the gh-pages branch, they have to be added to the additional-unit-test-report-directories
pkgdown workflow input.
Directory name on gh-pages branch where the unit test report will be uploaded.
If the unit test report directory is different than the default 'unit-test-report',
it has to be added to the additional-unit-test-report-directories pkgdown workflow input.
Additionally, if the non-default unit test report should be shown in the GitHub Pages
documentation drop-down, it has to be added to _pkgdown.yaml.
required: false
type: string
default: "unit-test-report"
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ on:
default: "."
additional-unit-test-report-directories:
description: |
If there are any additional unit test reports directories generated, they should be listed
as comma-separated directory list. If this input is empty, only coverage-report and
unit-test-report directories will be retained in the generated documentation directory.
If any *additional* unit test report directories are generated by the build-check-install workflow,
they should be listed as comma-separated directory list. If this input is empty, only coverage-report
and unit-test-report directories will be retained in the generated documentation directory.
Example:
unit-test-report-as-cran,unit-test-report-not-cran
required: false
Expand Down Expand Up @@ -264,9 +264,10 @@ jobs:
run: |
GH_PAGES_DIR="gh-pages/${{ steps.current-branch-or-tag.outputs.ref-name }}"
mkdir -p $GH_PAGES_DIR
echo "Current contents of $GH_PAGES_DIR:"
ls -l $GH_PAGES_DIR
# Remove any existing documentation for the git tag, but retain
# coverage report and unit test report which might have already been generated
# Remove any existing documentation for the git tag, but retain coverage report and
# unit test reports which might have already been pushed to the gh-pages branch
# by the coverage and build-check-install workflows respectively.
if [[ "${{ inputs.additional-unit-test-report-directories }}" != "" ]]; then
directories_to_retain="coverage-report,unit-test-report,${{ inputs.additional-unit-test-report-directories }}"
Expand All @@ -284,18 +285,20 @@ jobs:
# Check if the file/directory matches any directory to be retained.
for dir in "${DIRECTORIES_TO_RETAIN[@]}"; do
if [[ "$GH_PAGES_DIR/$dir" == "$file" ]]; then
echo "Not removing $file."
echo "Not removing $file"
file_to_be_removed="false"
fi
done
if [[ "$file_to_be_removed" == "true" ]]; then
echo "Removing $file."
echo "Removing $file"
rm -rf "$file"
fi
done
echo "Current contents of $GH_PAGES_DIR:"
ls -l $GH_PAGES_DIR
# Copy generated pkgdown documentation to gh-pages branch.
cp -a ${{ github.event.repository.name }}/${{ inputs.package-subdirectory }}/docs/. $GH_PAGES_DIR
echo "Current contents of $GH_PAGES_DIR:"
ls -l $GH_PAGES_DIR
cd gh-pages
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
Expand Down

0 comments on commit 90f3e0a

Please sign in to comment.