diff --git a/.circleci/config.yml b/.circleci/config.yml index 366993a030..ead922855a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -120,19 +120,25 @@ commands: - attach_workspace: at: *workspace_location + # Overwrite the yarn installed in the docker container with our own version. + overwrite_yarn: + description: Overwrite yarn with our own version + steps: + - run: + name: Overwrite yarn + command: | + localYarnPath=`node ./.circleci/get-vendored-yarn-path.js` + sudo chmod a+x $localYarnPath + sudo ln -fs $localYarnPath /usr/local/bin/yarn + - run: node --version + - run: yarn --version + # Initializes the CI environment by setting up common environment variables. init_environment: description: Initializing environment (setting up variables, overwriting Yarn) steps: - run: ./.circleci/env.sh - - run: - # Overwrite the yarn installed in the docker container with our own version. - name: Overwrite yarn with our own version - command: | - sudo chmod a+x $CI_LOCAL_YARN_PATH - sudo ln -fs $CI_LOCAL_YARN_PATH /usr/local/bin/yarn - - run: node --version - - run: yarn --version + - overwrite_yarn - run: # Configure git as the CircleCI `checkout` command does. # This is needed because we only checkout on the setup job. @@ -657,10 +663,16 @@ jobs: - init_environment - run: setPublicVar_CI_STABLE_BRANCH - run: - name: Check out `aio/` from the stable branch + name: Check out `aio/` and `third_party/github.com/yarnpkg/` from the stable branch command: | + localYarnDir=third_party/github.com/yarnpkg/ + # Remove the directory to ensure there will be only one version available (the one + # checked out from the stable branch below). + rm -rf $localYarnDir git fetch origin $CI_STABLE_BRANCH - git checkout --force origin/$CI_STABLE_BRANCH -- aio/ + git checkout --force origin/$CI_STABLE_BRANCH -- aio/ $localYarnDir + # Overwrite yarn again to use the version from the checked out branch. + - overwrite_yarn - run: name: Run tests against https://angular.io/ command: ./aio/scripts/test-production.sh https://angular.io/ $CI_AIO_MIN_PWA_SCORE diff --git a/.circleci/env.sh b/.circleci/env.sh index c5f9fcbc86..f9734fbfa5 100755 --- a/.circleci/env.sh +++ b/.circleci/env.sh @@ -35,7 +35,6 @@ setPublicVar CI_COMMIT_RANGE "`[[ ${CIRCLE_PR_NUMBER:-false} != false ]] && echo setPublicVar CI_PULL_REQUEST "${CIRCLE_PR_NUMBER:-false}"; setPublicVar CI_REPO_NAME "$CIRCLE_PROJECT_REPONAME"; setPublicVar CI_REPO_OWNER "$CIRCLE_PROJECT_USERNAME"; -setPublicVar CI_LOCAL_YARN_PATH "`node $projectDir/.circleci/get-vendored-yarn-path.js`"; ####################################################################################################