Skip to content

Commit

Permalink
ci: Tweak travis steps for danger/bundle size
Browse files Browse the repository at this point in the history
  • Loading branch information
bengourley committed Jul 12, 2019
1 parent 1bb4c2d commit 668c26f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ before_script:
- npx lerna run build --scope @bugsnag/browser
- cat packages/browser/dist/bugsnag.min.js | wc -c > .size/after-minified
- cat packages/browser/dist/bugsnag.min.js | gzip | wc -c > .size/after-gzipped
- git reset --hard HEAD
- git remote set-branches origin $TRAVIS_BRANCH
- git fetch
- git checkout $TRAVIS_BRANCH
- npm ci
- npx lerna bootstrap --ignore @bugsnag/expo
Expand Down
8 changes: 4 additions & 4 deletions dangerfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ const after = {

const formatKbs = (n) => `${(n / 1000).toFixed(2)} kB`

const diffMinSize = before.minified - after.minified
const diffZipSize = before.gzipped - after.gzipped
const diffMinSize = after.minified - before.minified
const diffZipSize = after.gzipped - before.gzipped
const showDiff = n => {
if (n > 0) return `⚠️ +${n} bytes ⬆️`
if (n < 0) return `-${n} bytes ⬇️`
if (n > 0) return `⚠️ \`+${n.toLocaleString()} bytes\``
if (n < 0) return `\`${n.toLocaleString()} bytes\``
return '_No change_'
}

Expand Down

0 comments on commit 668c26f

Please sign in to comment.