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 -
saveValue
method. - Get previously saved value for base branch from Storage API -
getValue
method. - Compare these values to get information how build size changed.
- Use our Report API to report back to github result of comparison -
report
method.
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 —
saveDirectory
method. - Retrieve previously saved screenshots for base branch from the Storage API —
getDirectory
method. - 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 —
saveDirectory
method. - Obtain the URL to the uploaded HTML report and attach it to Github PR by using Report API —
getArtifactLink
method.
Using similar logic you can implement code coverage tracking, performance tracking and basically whatever you want.