diff --git a/.github/workflows/build-check-install.yaml b/.github/workflows/build-check-install.yaml index a903041e..8967eb6a 100644 --- a/.github/workflows/build-check-install.yaml +++ b/.github/workflows/build-check-install.yaml @@ -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" diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index c11ce3b4..2b181db3 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -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 @@ -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 }}" @@ -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"