diff --git a/.azure-pipelines-steps.yml b/.azure-pipelines-steps.yml index d786455f6bff..7fd184534620 100644 --- a/.azure-pipelines-steps.yml +++ b/.azure-pipelines-steps.yml @@ -26,9 +26,15 @@ steps: displayName: 'Move source into jest folder' # Run yarn to install dependencies and build - - script: yarn --frozen-lockfile + - script: node scripts/remove-postinstall workingDirectory: $(JEST_DIR) - displayName: 'Install dependencies and build' + displayName: 'Remove postinstall script' + - script: yarn --no-progress --frozen-lockfile + workingDirectory: $(JEST_DIR) + displayName: 'Install dependencies' + - script: node scripts/build + workingDirectory: $(JEST_DIR) + displayName: 'Build' # Run test-ci-partial - script: yarn run test-ci-partial diff --git a/.circleci/config.yml b/.circleci/config.yml index 323151353c34..cf29628f4b33 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,6 +14,7 @@ aliases: - &filter-ignore-gh-pages branches: ignore: gh-pages + - &install node scripts/remove-postinstall && yarn --no-progress --frozen-lockfile --ignore-engines && node scripts/build version: 2 jobs: @@ -37,7 +38,7 @@ jobs: steps: - checkout - restore-cache: *restore-cache - - run: yarn --no-progress --frozen-lockfile --ignore-engines + - run: *install - save-cache: *save-cache - run: # react-native does not work with node 6 @@ -52,7 +53,7 @@ jobs: steps: - checkout - restore-cache: *restore-cache - - run: yarn --no-progress --frozen-lockfile + - run: *install - save-cache: *save-cache - run: command: yarn test-ci-partial @@ -66,7 +67,7 @@ jobs: steps: - checkout - restore-cache: *restore-cache - - run: yarn --no-progress --frozen-lockfile + - run: *install - save-cache: *save-cache - run: command: yarn test-ci @@ -80,7 +81,7 @@ jobs: steps: - checkout - restore-cache: *restore-cache - - run: yarn --no-progress --frozen-lockfile + - run: *install - save-cache: *save-cache - run: command: JEST_CIRCUS=1 yarn test-ci-partial @@ -94,7 +95,7 @@ jobs: steps: - checkout - restore-cache: *restore-cache - - run: yarn --no-progress --frozen-lockfile + - run: *install - save-cache: *save-cache - run: command: yarn test-ci-partial @@ -108,7 +109,7 @@ jobs: steps: - checkout - restore-cache: *restore-cache - - run: yarn --no-progress --frozen-lockfile + - run: *install - save-cache: *save-cache - run: yarn test-ci-es5-build-in-browser @@ -120,7 +121,7 @@ jobs: steps: - checkout - restore-cache: *restore-cache - - run: yarn --no-progress --frozen-lockfile + - run: *install - save-cache: *save-cache - run: name: Test or Deploy Jest Website diff --git a/.travis.yml b/.travis.yml index aa57b3e56377..6ab91e3060aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ before_install: - curl -o- -L https://yarnpkg.com/install.sh | bash - export PATH="$HOME/.yarn/bin:$PATH" -install: yarn --frozen-lockfile +install: node scripts/remove-postinstall && yarn --no-progress --frozen-lockfile --ignore-engines && node scripts/build cache: yarn: true diff --git a/scripts/remove-postinstall.js b/scripts/remove-postinstall.js new file mode 100644 index 000000000000..a4b10c50f6b5 --- /dev/null +++ b/scripts/remove-postinstall.js @@ -0,0 +1,13 @@ +// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + +'use strict'; + +const {writeFileSync} = require('fs'); + +const pkgPath = require.resolve('../package.json'); + +const pkg = require('../package.json'); + +delete pkg.scripts.postinstall; + +writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`);