diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7b94526e804..7708819066a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,13 +1,32 @@ -name: Build +name: Testing Build -on: [push] +on: + pull_request: + types: + - opened + - synchronize + - closed jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 + - name: Cache node modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- - name: Install run: yarn --no-progress --non-interactive --no-lockfile - name: Build run: yarn build + env: + GITHUB_PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml deleted file mode 100644 index 1249f20532f..00000000000 --- a/.github/workflows/integration.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Integration Tests - -on: - push: - branches: - - master - pull_request: - branches: - - master - -jobs: - job: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] - node: ['10', '12', '14'] - steps: - - uses: actions/checkout@v2 - - name: Setup node - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node }} - - name: Cache dependencies - id: cache - uses: actions/cache@v2 - with: - path: | - node_modules - */*/node_modules - key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock', './yarn.lock') }} - - name: Install packages - if: steps.cache.outputs.cache-hit != 'true' - run: yarn --frozen-lockfile --prefer-offline - - name: Run integration tests - run: yarn test:integration diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index a2e7567d1e1..00000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Lint - -on: [push] - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Install - run: yarn --no-progress --non-interactive --no-lockfile - - name: Alex - run: yarn alex diff --git a/package.json b/package.json index a5c093bf32e..bcb0ddf266d 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", "alex": "^8.2.0", + "asset-compare-git-webpack-plugin": "https://github.com/supriya-raj/asset-compare-git-webpack-plugin#1a8c2fe3acbb049b050fae9deb5ab3733af3791d", "eslint": "^7.11.0", "execa": "1.0.0", "fs-extra": "^9.0.1", diff --git a/packages/react-scripts/bin/react-scripts.js b/packages/react-scripts/bin/react-scripts.js index 09604f6a03f..dc3894a1733 100755 --- a/packages/react-scripts/bin/react-scripts.js +++ b/packages/react-scripts/bin/react-scripts.js @@ -15,6 +15,8 @@ process.on('unhandledRejection', err => { throw err; }); +console.log(process.env); + const spawn = require('react-dev-utils/crossSpawn'); const args = process.argv.slice(2); diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index 5e5f87f3ce9..6c3c6ab1c39 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -8,6 +8,7 @@ // @remove-on-eject-end 'use strict'; +const AssetComparePlugin = require('asset-compare-git-webpack-plugin'); const fs = require('fs'); const path = require('path'); const webpack = require('webpack'); @@ -788,6 +789,9 @@ module.exports = function (webpackEnv) { }, }, }), + new AssetComparePlugin({ + gist_id: '3372502a4187b06e810e07f1b20b6d24', + }), ].filter(Boolean), // Some libraries import Node modules but don't use them in the browser. // Tell webpack to provide empty mocks for them so importing them works. diff --git a/webpack-asset-sizes.json b/webpack-asset-sizes.json new file mode 100644 index 00000000000..8b242d2f37f --- /dev/null +++ b/webpack-asset-sizes.json @@ -0,0 +1 @@ +[{"name":"index.html","size":3034},{"name":"main","size":943},{"name":"static/js/2.49c628d1.chunk.js","size":131280},{"name":"static/js/2.49c628d1.chunk.js.LICENSE.txt","size":1043},{"name":"static/js/3.4fd48114.chunk.js","size":4398},{"name":"main","size":1047},{"name":"runtime-main","size":2374}] \ No newline at end of file diff --git a/webpack-asset-stats.json b/webpack-asset-stats.json new file mode 100644 index 00000000000..8b242d2f37f --- /dev/null +++ b/webpack-asset-stats.json @@ -0,0 +1 @@ +[{"name":"index.html","size":3034},{"name":"main","size":943},{"name":"static/js/2.49c628d1.chunk.js","size":131280},{"name":"static/js/2.49c628d1.chunk.js.LICENSE.txt","size":1043},{"name":"static/js/3.4fd48114.chunk.js","size":4398},{"name":"main","size":1047},{"name":"runtime-main","size":2374}] \ No newline at end of file