Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#120: add reusable workflow to check pkgdown builds. #121

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

k-doering-NOAA
Copy link
Collaborator

This pull request addresses #120.

@Bai-Li-NOAA this is ready for testing. I think you can use a file like the below to test on a branch.

I did try testing using the file below on the ghactions4r pkgdown site. I broke the pkgdown build, and confirmed that the github action failed. I also confirmed that the html was saved as an artifact for successful runs (these commits were on the check-pkgdown branch, but I have removed them).

# Checks that the pkgdown site builds for a repository.
# this assumes pkgdown is already set up.
name: call-build-pkgdown
# on specifies the build triggers. See more info at https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
on:
  push:
jobs:
  call-workflow:
    uses: nmfs-fish-tools/ghactions4r/.github/workflows/build-pkgdown.yml@check-pkgdown

@Bai-Li-NOAA
Copy link
Collaborator

Thank you, Kathryn. I plan to test the workflow on May 29.

Copy link
Collaborator

@Bai-Li-NOAA Bai-Li-NOAA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks @k-doering-NOAA for setting up the reusable workflow. I successfully called it in FIMS.

Initially, the GHA failed when I broke the pkgdown build. Then the html was uploaded to the Actions page for successful runs.

I assume the failed checks on the pull request will run successfully after merging the changes into the main branch. I wonder if the errors from local checks can be resolved by writing custom expectations (e.g., expect_proj_file()). I've seen some examples in the {usethis} tests, but the utility functions for the active project seem very complicated.

@k-doering-NOAA
Copy link
Collaborator Author

Thanks @Bai-Li-NOAA , I just opened a new issue (#127 ) for your comment about the tests, which I think is a good point. We always expect the tests to fail for new actions on a feature branch and not yet merged into main using our current workflow, which is not helpful.

@k-doering-NOAA k-doering-NOAA merged commit 83c1492 into main Jun 3, 2024
3 of 10 checks passed
@k-doering-NOAA k-doering-NOAA deleted the check-pkgdown branch June 3, 2024 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants