diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e70e13cb52..3ebb67c48e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,8 +11,8 @@ jobs: with: node-version: '14' cache: 'npm' - - name: Install npm@7 - run: npm i -g npm@7 + - name: Install npm@8 + run: npm i -g npm@8 - name: Install run: npm ci --prefer-offline - name: Build diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 66e9dd59dc..88699dfa27 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -22,8 +22,8 @@ jobs: with: node-version: ${{ matrix.node }} cache: 'npm' - - name: Install npm@7 - run: npm i -g npm@7 + - name: Install npm@8 + run: npm i -g npm@8 - name: Install yarn run: npm i -g yarn - name: Install packages diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ba82da56f3..d9835010a9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,8 +11,8 @@ jobs: with: node-version: '14' cache: 'npm' - - name: Install npm@7 - run: npm i -g npm@7 + - name: Install npm@8 + run: npm i -g npm@8 - name: Install run: npm ci --prefer-offline - name: Alex diff --git a/azure-pipelines-test-job.yml b/azure-pipelines-test-job.yml index fb3ce4eff9..cdf3f4dacf 100644 --- a/azure-pipelines-test-job.yml +++ b/azure-pipelines-test-job.yml @@ -31,8 +31,8 @@ jobs: versionSpec: $(nodeVersion) displayName: 'Install Node.js' - - script: npm i -g npm@7 - displayName: 'Update npm to v7' + - script: npm i -g npm@8 + displayName: 'Update npm to v8' - script: npm ci displayName: 'Run npm ci' diff --git a/tasks/e2e-behavior.sh b/tasks/e2e-behavior.sh index 2619ed5aa0..79059fdf94 100755 --- a/tasks/e2e-behavior.sh +++ b/tasks/e2e-behavior.sh @@ -61,14 +61,6 @@ set -x cd .. root_path=$PWD -if hash npm 2>/dev/null -then - npm i -g --force npm@latest -fi - -# Bootstrap monorepo -npm install - # ****************************************************************************** # First, publish the monorepo. # ****************************************************************************** diff --git a/tasks/e2e-installs.sh b/tasks/e2e-installs.sh index 5736507318..92407134a6 100755 --- a/tasks/e2e-installs.sh +++ b/tasks/e2e-installs.sh @@ -83,14 +83,6 @@ set -x cd .. root_path=$PWD -if hash npm 2>/dev/null -then - npm i -g npm@latest -fi - -# Bootstrap monorepo -npm install - # ****************************************************************************** # First, publish the monorepo. # ****************************************************************************** diff --git a/tasks/e2e-kitchensink-eject.sh b/tasks/e2e-kitchensink-eject.sh index 622a396d65..fa124f9ec3 100755 --- a/tasks/e2e-kitchensink-eject.sh +++ b/tasks/e2e-kitchensink-eject.sh @@ -69,14 +69,6 @@ if [ "$AGENT_OS" == 'Windows_NT' ]; then root_path=$(cmd //c cd) fi -if hash npm 2>/dev/null -then - npm i -g npm@latest -fi - -# Bootstrap monorepo -npm install - # ****************************************************************************** # First, publish the monorepo. # ****************************************************************************** diff --git a/tasks/e2e-kitchensink.sh b/tasks/e2e-kitchensink.sh index c29b9840c3..48af65e603 100755 --- a/tasks/e2e-kitchensink.sh +++ b/tasks/e2e-kitchensink.sh @@ -69,14 +69,6 @@ if [ "$AGENT_OS" == 'Windows_NT' ]; then root_path=$(cmd //c cd) fi -if hash npm 2>/dev/null -then - npm i -g npm@latest -fi - -# Bootstrap monorepo -npm install - # ****************************************************************************** # First, publish the monorepo. # ****************************************************************************** diff --git a/tasks/e2e-simple.sh b/tasks/e2e-simple.sh index 3d01fba6f0..55f777fc5b 100755 --- a/tasks/e2e-simple.sh +++ b/tasks/e2e-simple.sh @@ -76,14 +76,6 @@ if [ "$EXPECTED" != "$ACTUAL" ]; then exit 1 fi -if hash npm 2>/dev/null -then - npm i -g npm@latest -fi - -# Bootstrap monorepo -npm install - # Start the local NPM registry startLocalRegistry "$root_path"/tasks/verdaccio.yaml diff --git a/tasks/local-test.sh b/tasks/local-test.sh index 0e8af29f0b..0a9bd35fe3 100755 --- a/tasks/local-test.sh +++ b/tasks/local-test.sh @@ -4,26 +4,26 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. +node_version=14 +current_git_branch=`git rev-parse --abbrev-ref HEAD` +git_branch=${current_git_branch} +test_suite=all +interactive=false + function print_help { echo "Usage: ${0} [OPTIONS]" echo "" echo "OPTIONS:" - echo " --node-version the node version to use while testing [12]" - echo " --git-branch the git branch to checkout for testing [the current one]" - echo " --test-suite which test suite to use ('all', 'behavior', installs', 'kitchensink', 'kitchensink-eject', 'simple') ['all']" - echo " --interactive gain a bash shell after the test run" + echo " --node-version the node version to use while testing [${node_version}]" + echo " --git-branch the git branch to checkout for testing [${current_git_branch}]" + echo " --test-suite which test suite to use ('all', 'behavior', installs', 'kitchensink', 'kitchensink-eject', 'simple') ['${test_suite}']" + echo " --interactive gain a bash shell after the test run [${interactive}]" echo " --help print this message and exit" echo "" } cd $(dirname $0) -node_version=14 -current_git_branch=`git rev-parse --abbrev-ref HEAD` -git_branch=${current_git_branch} -test_suite=all -interactive=false - while [ "$1" != "" ]; do case $1 in "--node-version") @@ -84,6 +84,8 @@ cd - mv /var/create-react-app/patch . git apply patch rm patch +git add -A +git commit -m 'Apply local changes' CMD if [ ${git_branch} != ${current_git_branch} ]; then @@ -91,15 +93,15 @@ if [ ${git_branch} != ${current_git_branch} ]; then fi read -r -d '' command <<- CMD -echo "prefix=~/.npm" > ~/.npmrc -mkdir ~/.npm -export PATH=\$PATH:~/.npm/bin +npm install npm@8 -g +export PATH=\$(npm config get prefix -g)/bin:\$PATH set -x git clone /var/create-react-app create-react-app --branch ${git_branch} cd create-react-app ${apply_changes} node --version npm --version +npm ci set +x ${test_command} result_code=\$?