github-action-benchmark icon indicating copy to clipboard operation
github-action-benchmark copied to clipboard

Use NCC

Open jasonwilliams opened this issue 5 years ago • 3 comments

I've noticed for your v1 branch you've had to commit the node_modules folder into VC for your js scripts to work. You can use ncc instead, this will package up everything into a single file, you can then just ship that.

I use it here: https://github.com/jasonwilliams/criterion-compare-action/blob/master/package.json#L8

jasonwilliams avatar Jan 20 '20 22:01 jasonwilliams

Thank you for the suggestion but I'm not understanding the benefit to make a single executable for GitHub Action. JavaScript action is assumed to be Node.js module so having multiple sources would be OK. And I already prepared a small script to make release and it works well.

Since GitHub Action is run in virtual environment, it's hard to debug. I want to avoid extra code transforming (e.g. bundling with webpack) as much as possible.

rhysd avatar Jan 21 '20 09:01 rhysd

Thank you for the suggestion but I'm not understanding the benefit

I think the main benefit is not having to commit the hundreds of JS files from node_modules into VC.

JavaScript action is assumed to be Node.js module so having multiple sources would be OK. And I already prepared a small script to make release and it works well.

Fair enough

jasonwilliams avatar Jan 21 '20 09:01 jasonwilliams

I think the main benefit is not having to commit the hundreds of JS files from node_modules into VC.

How is the difference? Is there any performance regression when using node_modules directory with bunch of npm packages in your case? I tried to check size of the v1 branch as follows:

$ git clone --depth=1 --branch v1 https://github.com/rhysd/github-action-benchmark
$ tar cf tmp.tar ./github-action-benchmark
$ ls -lh tmp.tar

and the size was 5.5 MB. I feel it is not so large. So until it is clear that there is a real benefit, I don't think we should not add another transformation like bundling or minifying since it has obvious downside that it introduces additional complexity to release artifacts.

rhysd avatar Jan 21 '20 11:01 rhysd

Closing because of no response. Feel free to reopen.

ningziwen avatar May 09 '23 21:05 ningziwen