actions icon indicating copy to clipboard operation
actions copied to clipboard

Optionally install dev version of pandoc

Open hadley opened this issue 5 years ago • 9 comments

Which is useful for testing packages that heavily rely on pandoc.

@yihui is providing pre-built binaries that we could use.

hadley avatar Oct 03 '20 13:10 hadley

Pandoc has very pretty frequent releases, I am not sure it would be worth the effort.

jimhester avatar Oct 06 '20 17:10 jimhester

pandoc releases have been a bit bumpy lately, so being able to install the dev version would be very useful, albeit for only a handful of packages.

hadley avatar Oct 06 '20 17:10 hadley

I discovered pandoc is building nightly using GHA and binaries are available as artifacts: https://github.com/jgm/pandoc/actions/runs/327037265

There is no standard url available but with the API it can be downloaded. The pre-built binary made available by Yihui for Linux and used through several packages now uses (https://github.com/yihui/travis-bin/issues/4) this nighlty build: https://travis-bin.yihui.org/ which offer a "fixed" url : https://travis-bin.yihui.org/pandoc-linux.zip

I don't know if artifacts in GHA can be retrieved easily from one project to another as it would surely be easier. Otherwise, this url can be used I guess.

Testing with last available Pandoc is required for some package in order to detect changes as soon as possible. Pandoc does not do pre-release. A weekly build would surely be enough if nightly is too much - it is not so difficult to build some binaries from pandoc example: https://github.com/jgm/pandoc/blob/master/.github/workflows/nightly.yml

cderv avatar Oct 26 '20 16:10 cderv

As I wanted to have a test on Pandoc devel for our new GHA workflow (currently being setup), I created an action using composite steps to directly get the last nightly build available from jgm/pandoc.

It lives currently in my fork: https://github.com/cderv/actions/tree/nightly-pandoc/setup-pandoc-nightly

This works on 3 OS and does not rely on the travis-bin repos that gets the linux binary from the nightly pandoc build, and serves it at a fixed url. (using GHA now). it is using the github api to get some information about the runs, and get the artifact link to download. Then it unzips in the workspace and prepend in PATH. Same logic I put in travis-bin also.

To use it, you obviously need use a new actions in a workflow specific for the devel version in addition to the setup-pandoc one. It would be easier to use with: 'devel' in the setup-pandoc action I believe, but it works well that way too.

Anyway, I let you decide which is the best for the future.

  • If you are interesting in this action as a composite one, I can make a PR and we can improve it.
  • If you want to integrate in setup-pandoc, what I have done in those two project above works ok (using the github API), so I believe it would work well with the actions using JS, with their JS API https://octokit.github.io/rest.js/v18.
  • If you think it should live elsewhere than r-lib/actions (not sure why but why not), it may be better that I make a new repo and not rely on a branch of this repo, right ?

So in the end just sharing what I have done. It was a great way to get more familiar with GHA. Happy to modify the GHA workflows of that will use it when there will be a solution for devel Pandoc embedded in setup-pandoc

cderv avatar Nov 20 '20 18:11 cderv

Is this still desired?

gaborcsardi avatar Dec 10 '21 10:12 gaborcsardi

In the R Markdown ecosystem we test against the dev version of Pandoc, and for that we are using my fork cderv/actions@nightly-pandoc/setup-pandoc-nightly https://github.com/rstudio/rmarkdown/blob/69e6f983fdd9fca18284509eb6fed8fc4c0fc3f7/.github/workflows/R-CMD-check.yaml#L64-L70

So this is working fine but it would still be easier (or more logic) to have a with: nightly available as parameter in main pandoc I guess.

cderv avatar Dec 10 '21 10:12 cderv

@cderv Thanks! Would it be easy to have a PR against this repo?

gaborcsardi avatar Dec 10 '21 11:12 gaborcsardi

Yes I can do that. Though, it depends how we want to do it. My action is a composite action, so I could PR it like that it would need to be used the way I used - a variable and conditional use of one or the other action.

To be included into current setup-pandoc, my action would need to be rewritten in TypeScript or setup-pandoc rewritten to be included a steps in a composite action. I can try one or the other, but it is less straightforward.

Which is better ?

cderv avatar Dec 10 '21 13:12 cderv

This might be a good project for @schloerke

hadley avatar Dec 10 '21 13:12 hadley

Will be handled in #469.

gaborcsardi avatar Oct 19 '22 13:10 gaborcsardi

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue and include a link to this issue

github-actions[bot] avatar Nov 04 '22 13:11 github-actions[bot]