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

GH actions for rendering of README.Rmd #17

Merged
merged 37 commits into from
Dec 13, 2024
Merged

GH actions for rendering of README.Rmd #17

merged 37 commits into from
Dec 13, 2024

Conversation

jibarozzo
Copy link
Contributor

Included render-markdown.yaml through usethis::use_github_action("render-rmarkdown") default settings. I added dummy test in .Rmd

@jibarozzo jibarozzo marked this pull request as draft December 11, 2024 18:20
Removed use of `renv`  through `- uses: r-lib/actions/setup-renv@v2`
R chunk renamed
Split jobs to increase clarity. Installed R dependencies and `rmarkdown`.
Adding `name: render-rmarkdown.yaml` so it includes it in checks
Adding `read-all` permissions
R dependencies and rendering seem to work. Action failed at Rmarkdown render files job
@jibarozzo jibarozzo closed this Dec 11, 2024
@jibarozzo jibarozzo reopened this Dec 11, 2024
@jibarozzo jibarozzo self-assigned this Dec 11, 2024
@jibarozzo jibarozzo added the upkeep maintenance, infrastructure, and similar label Dec 11, 2024
@jibarozzo jibarozzo marked this pull request as ready for review December 11, 2024 21:59
@jibarozzo jibarozzo requested review from jdhoffa and asbates December 11, 2024 21:59
@jibarozzo
Copy link
Contributor Author

jibarozzo commented Dec 11, 2024

This PR addresses #16. It triggers on every PR and on main (I believe). All checks pass.

@jibarozzo jibarozzo linked an issue Dec 11, 2024 that may be closed by this pull request
Copy link
Member

@jdhoffa jdhoffa left a comment

Choose a reason for hiding this comment

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

Thanks so much for this!! It's looking awesome.
I have a few knit comments and one suggestion.

.github/workflows/render-rmarkdown.yaml Outdated Show resolved Hide resolved
.github/workflows/render-rmarkdown.yaml Show resolved Hide resolved
README.Rmd Outdated Show resolved Hide resolved
Co-authored-by: Jackson Hoffart <[email protected]>
@jibarozzo jibarozzo marked this pull request as draft December 12, 2024 18:33
Modified checkout to PR branch in order to render README and commit to PR branch which then gets merged to main. At least that is what should happen.
@jibarozzo
Copy link
Contributor Author

jibarozzo commented Dec 12, 2024

This PR's last two commits successfully detect changes in .Rmd files and trigger the re-build of README.md. Last commits do not have checks since they are triggered by them.

Changes from last review.

  • Includes new job Showing GH context refs: This allows for debugging and tracing knowing where things are being committed.
  • Added env variable BRANCH_NAME
  • Checkout PR branch job targets ${{ github.ref }}: Makes sure we checkout to current PR branch, no a detached head which is the default.
  • Fixed typo in README.Rmd that hindered installation of blazr for example
  • Added git push origin HEAD:${{ github.head_ref }}: This is commits to the current PR branch, because even after checkout it is still a 'headless' environment that it is working on. Based on error results from commit 845f0f5 (see Commit Results section in test). Commit 09dac1f correctly addresses this issue.

TODO

@jibarozzo jibarozzo marked this pull request as ready for review December 12, 2024 22:53
@jibarozzo jibarozzo requested a review from jdhoffa December 12, 2024 22:53
Copy link
Member

@jdhoffa jdhoffa left a comment

Choose a reason for hiding this comment

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

A note about the changes to README, but the action itself looks awesome!!
Hell yeah, thank you 😊

README.Rmd Outdated Show resolved Hide resolved
.github/workflows/render-rmarkdown.yaml Outdated Show resolved Hide resolved
.github/workflows/render-rmarkdown.yaml Show resolved Hide resolved
@jibarozzo jibarozzo marked this pull request as draft December 13, 2024 16:51
@jibarozzo
Copy link
Contributor Author

Changes post 25d9967:

  • Reverted README.Rmd
  • Installed blazr with GH action Setup R dependencies. See message in GH action render-mardown.yaml > Setup R dependencies > Install/update packages

No new README.md was generated with da8472b. Previous commit d14b064 would generated the new file but blazr was not installed.
Overall, this PR successfully detects changes in .Rmd, triggers installation of blazr through job in render-markdonw.yaml and renders new README.md

@jibarozzo jibarozzo marked this pull request as ready for review December 13, 2024 17:09
@jibarozzo jibarozzo requested a review from jdhoffa December 13, 2024 17:10
Copy link
Member

@jdhoffa jdhoffa left a comment

Choose a reason for hiding this comment

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

Two suggestions to get the README.* files back to 0 diff 😊

README.Rmd Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Member

@jdhoffa jdhoffa left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@jibarozzo jibarozzo merged commit 7c7e869 into main Dec 13, 2024
@jibarozzo jibarozzo deleted the Rmd_GH_action branch December 13, 2024 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upkeep maintenance, infrastructure, and similar
Projects
Development

Successfully merging this pull request may close these issues.

🏗️ gains GH action to automatically render README.Rmd
2 participants