-
Notifications
You must be signed in to change notification settings - Fork 34
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
document best practices for CI/CD for react-based htmlwidgets #37
Comments
Hi Max, do I understand correctly that your goal is to keep compiled JS out of the git repo? Are you pursuing this in order to keep the repo size down? I'm not sure it's something we should recommend to everyone, since I imagine for most people the burden of a slightly larger git repo does not override the convenience of That said, it's an awesome thing to document if you're willing, and I think has applicability beyond reactR. Pretty much any htmlwidget/Shiny development that involves JS transforms or linting of some kind could benefit from an established workflow. I'm no Github Actions experts but your .yml makes sense to me and looks similar to what I've seen done in Travis setups. One thing you might consider is a step to "deploy" the built package file as a Github release, or otherwise make it available as something that could be consumed via |
Thanks, great idea(s). My concern wasn't with repo size, but I just really dislike having programmatically generated files inside my commits; makes it hard to parse the diffs. Makes sense though that the tradeoff might not be worth it for most users. I'll look into GitHub Releases (or, I guess, GitHub Package Manager would be ideal for this -- if it ever supports R packages). |
I did come across a suggestion to use |
Oh, re: diffs there is a way to configure git (via Even so I think there is advantage to keeping generating code out of git. Other than for size, for security and reproducibility; it's very hard to know if e.g. the generated code associated with a PR is free of exploits, and was generated by a means that can be reproduced. On Shiny, for instance, we keep generated code in the repo but have to remember to periodically regenerate it by trusted means. Beyond the inconvenience of having to remember to do this, doing so can cause merge conflicts that waste time to deal with. GitHub Package Manager is a cool idea, but I don't know much about it. Thanks again for sharing your discoveries in this area, it's valuable work you're doing. |
I'm trying to run CI/CD (with GitHub actions) on a nascent htmlwidgets package for a react library, ideally without any derived files in the commits.
So in addition to the system requirements in #36, I'm running
yarn install
, andyarn run webpack --mode=development
in CICD as well as gitignore the crosscompiled js ininst/htmlwidgets
.This keeps the commits lean, and seems to work ok so far: here's the action running off of this github actions workflow.
This way of doing things of course breaks anything like
remotes::install_github()
.What are your suggestions for best CI/CD practices? Am I on the wrong track here?
With some guidance, I'd be happy to add a section about this to the vignette in a PR.
The text was updated successfully, but these errors were encountered: