artus9033 / chartjs-plugin-dragdata

Draggable data points plugin for Chart.js
MIT License
257 stars 55 forks source link

fix(ci): manually trigger postinstall in CI workflow if cache was used instead of npm i #135

Closed artus9033 closed 3 months ago

artus9033 commented 3 months ago

Describe your changes

Since the recent changes applied a cache to ci workflows, npm ci is not run when the cache is restored, which in turn implies that the postinstall script won't be invoked. The postinstall script, however, triggered npx playwright install, which installed playwright's browsers binaries to ~/.cache/ms-playwright. What would fix the problem would either be running this manually if the cache was restored instead of npm ci having been run, or to cache ~/.cache/ms-playwright.

As others have already encountered this problem as well and noticed here that download times are very fast, this PR introduces the first approach: to run npm run postinstall manuall, which is also more scalable since this will always download the newest supported browser binaries; for speed-up, this step is only added to ci.yml, but not to cd.yml (which does not need neither playwright, nor lefthook).

Linked issues (if any)

N/A

Checklist before requesting a review