mirror of
https://github.com/facebook/react.git
synced 2026-02-23 20:23:02 +00:00
sizebot comments can be confusing when not based on reality. If results.json doesn't exist, danger will fail. This is what we want.
24 lines
899 B
Bash
Executable File
24 lines
899 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
# On master, download the bundle sizes from last master build so that
|
|
# the size printed in the CI logs for master commits is accurate.
|
|
# We don't do it for pull requests because those are compared against
|
|
# the merge base by Dangerfile instead. See https://github.com/facebook/react/pull/12606.
|
|
if [ -z "$CI_PULL_REQUEST" ]; then
|
|
curl -o scripts/rollup/results.json http://react.zpao.com/builds/master/latest/results.json
|
|
else
|
|
# If build fails, cause danger to fail/abort too
|
|
rm scripts/rollup/results.json
|
|
fi
|
|
|
|
yarn build --extract-errors
|
|
# Note: since we run the full build including extracting error codes,
|
|
# it is important that we *don't* reset the change to `scripts/error-codes/codes.json`.
|
|
# When production bundle tests run later, it needs to be available.
|
|
# See https://github.com/facebook/react/pull/11655.
|
|
|
|
# Do a sanity check on bundles
|
|
yarn lint-build
|