From 8c23e16984823dcd29e12f9f5d7a4b8fec9e389f Mon Sep 17 00:00:00 2001 From: Ben Gourley Date: Thu, 17 Dec 2020 12:31:02 +0000 Subject: [PATCH] ci: Migrate bundle size bot from Travis to GitHub actions --- .github/workflows/pr-size.yml | 45 +++++++++++++++++++++++++++++++++++ .travis.yml | 22 ----------------- 2 files changed, 45 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/pr-size.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/pr-size.yml b/.github/workflows/pr-size.yml new file mode 100644 index 0000000000..e3a876492a --- /dev/null +++ b/.github/workflows/pr-size.yml @@ -0,0 +1,45 @@ +name: "PR size bot" +on: [pull_request] + +jobs: + build: + name: PR size bot + runs-on: ubuntu-latest + steps: + - name: Setup node + uses: actions/setup-node@v1 + with: + node-version: 14.x + + - name: Checkout PR branch + uses: actions/checkout@v1 + + - name: Install dependencies + run: npm ci + + - name: Record PR size + run: | + mkdir .size + npx lerna bootstrap --ignore @bugsnag/expo --ignore @bugsnag/react-native + 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 + + - name: Checkout base branch + uses: actions/checkout@v1 + with: + ref: ${{ github.base_ref }} + clean: false + + - name: Record target branch size + run: | + npm ci + npx lerna bootstrap --ignore @bugsnag/expo --ignore @bugsnag/react-native + npx lerna run build --scope @bugsnag/browser + cat packages/browser/dist/bugsnag.min.js | wc -c > .size/before-minified + cat packages/browser/dist/bugsnag.min.js | gzip | wc -c > .size/before-gzipped + + - name: Run danger + uses: danger/danger-js@9.1.6 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9f4b44ac2c..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: node_js -node_js: - - "12" -before_script: - - mkdir .size - - npx lerna bootstrap --ignore @bugsnag/expo --concurrency 1 - - 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 - - npx lerna run build --scope @bugsnag/browser - - cat packages/browser/dist/bugsnag.min.js | wc -c > .size/before-minified - - cat packages/browser/dist/bugsnag.min.js | gzip | wc -c > .size/before-gzipped - - git reset --hard HEAD - - git checkout - -script: - - npx danger ci