In this section we will provide high level overview how to build useful stuff using our system.
- Measure size of files that you're interested in (just grab some lib from NPM or use
fs.stat). We treat that value as an artifact. - Save value to Storage API for current commit -
saveValuemethod. - Get previously saved value for base branch from Storage API -
getValuemethod. - Compare these values to get information how build size changed.
- Use our Report API to report back to github result of comparison -
reportmethod.
This is a literally description of what @codechcecks/build-size-watcher does.
- Obtain screenshots of the current state of the app. Use one of many libraries to make screenshots of storybook or make screenshots during E2E tests.
- Save directory with screenshots for current commit using Storage API —
saveDirectorymethod. - Retrieve previously saved screenshots for base branch from the Storage API —
getDirectorymethod. - Compare screenshots using one of many libraries available on NPM and create HTML report describing all changes etc.
- Upload the HTML report as normal artifact — artifacts are browserable by default —
saveDirectorymethod. - Obtain the URL to the uploaded HTML report and attach it to Github PR by using Report API —
getArtifactLinkmethod.
Using similar logic you can implement code coverage tracking, performance tracking and basically whatever you want.