trainline/webpack-bundle-delta

real life ci example

djalmaaraujo opened this issue · 2 comments

Hello! Thanks for this great tool. I just got here by reading the excellent article on medium. I am considering setting up this project into our ci integration, but I could not figure out how to get a previous stats.json from a previous build to compare with the current stats.json? Do you have a real-world example with Github actions, for instance?

I can think of many possibilities, but I wonder if you already have a GitHub workflow ready to go?

Thank you.

Hi, sorry for the big delay on response. I'll have to get back to you on it as I'm on holiday at present and only thought to look at the repo now.

Off the top of my head it's more that you would need a way to pull the build artifact in yourself into the PR branch and then compare it. I would have to do some investigating to see how to best write a GitHub action that would take care of this for you as it isn't present functionality.

hi, sorry i haven't gotten back sooner. the reason i didn't originally build a github action for this is because it would require a fair amount of setup and present actions like the upload-artifact action don't support working across branches. in essence you'd need to work out how to store the stats and fetch it back again. in a corporate/enterprise environment where you have your own way of storing artifacts, it becomes a lot easier, but there is still a bunch of know how per individual project setup (such as where does the output of the stats end up to then upload it to somewhere).