From 1af511834e180219f8a82b3efcca87f473b9ee98 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Thu, 25 Feb 2021 11:54:49 -0500 Subject: [PATCH 1/2] ci: use CircleCI matrix support for E2E jobs --- .circleci/config.yml | 58 ++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 34 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3bfc219998ae..6c06659f11be 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -179,13 +179,18 @@ jobs: e2e-cli: parameters: + nodeversion: + type: string + default: *default_nodeversion ve: type: boolean default: false snapshots: type: boolean default: false - executor: test-executor + executor: + name: test-executor + nodeversion: << parameters.nodeversion >> parallelism: 6 steps: - custom_attach_workspace @@ -204,19 +209,6 @@ jobs: mkdir /mnt/ramdisk/e2e-yarn PATH=~/.npm-global/bin:$PATH node ./tests/legacy-cli/run_e2e --nb-shards=${CIRCLE_NODE_TOTAL} --shard=${CIRCLE_NODE_INDEX} <<# parameters.ve >>--ve<> <<# parameters.snapshots >>--ng-snapshots<> --yarn --tmpdir=/mnt/ramdisk/e2e-yarn --glob="{tests/basic/**,tests/update/**}" - e2e-cli-node-14: - executor: - name: test-executor - nodeversion: "14.15" - parallelism: 6 - steps: - - custom_attach_workspace - - browser-tools/install-chrome - - run: - name: Initialize Environment - command: ./.circleci/env.sh - - run: PATH=~/.npm-global/bin:$PATH node ./tests/legacy-cli/run_e2e --nb-shards=${CIRCLE_NODE_TOTAL} --shard=${CIRCLE_NODE_INDEX} - test-browsers: executor: name: test-executor @@ -334,20 +326,27 @@ workflows: requires: - setup - e2e-cli: + name: e2e-cli<<# matrix.ve >>-ve<> + matrix: + alias: e2e-cli-renderers + parameters: + ve: [true, false] post-steps: - - store_artifacts: - path: /tmp/dist - destination: cli/new-production + - unless: + condition: << matrix.ve >> + steps: + - store_artifacts: + path: /tmp/dist + destination: cli/new-production requires: - build - e2e-cli: - name: e2e-cli-ve - ve: true - requires: - - build - - e2e-cli: - name: e2e-cli-ng-snapshots + name: e2e-cli-ng<<# matrix.ve >>-ve<>-snapshots snapshots: true + matrix: + alias: e2e-cli-renderers-snapshots + parameters: + ve: [true, false] requires: - e2e-cli filters: @@ -356,17 +355,8 @@ workflows: - renovate/angular - master - e2e-cli: - name: e2e-cli-ng-ve-snapshots - snapshots: true - ve: true - requires: - - e2e-cli - filters: - branches: - only: - - renovate/angular - - master - - e2e-cli-node-14: + name: e2e-cli-node-14 + nodeversion: "14.15" <<: *only_release_branches requires: - e2e-cli From 53e3b1e486e2ed82170cca1a2c2c28c41d7f34c1 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Thu, 25 Feb 2021 13:40:37 -0500 Subject: [PATCH 2/2] ci: move npm prefix config to env helper script --- .circleci/config.yml | 10 ++++------ .circleci/env.sh | 2 ++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6c06659f11be..7ce915cc0940 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -53,8 +53,6 @@ executors: docker: - image: cimg/node:<< parameters.nodeversion >> working_directory: ~/ng - environment: - NPM_CONFIG_PREFIX: ~/.npm-global resource_class: large windows-executor: @@ -202,12 +200,12 @@ jobs: name: Execute CLI E2E Tests command: | mkdir /mnt/ramdisk/e2e-main - PATH=~/.npm-global/bin:$PATH node ./tests/legacy-cli/run_e2e --nb-shards=${CIRCLE_NODE_TOTAL} --shard=${CIRCLE_NODE_INDEX} <<# parameters.ve >>--ve<> <<# parameters.snapshots >>--ng-snapshots<> --tmpdir=/mnt/ramdisk/e2e-main + node ./tests/legacy-cli/run_e2e --nb-shards=${CIRCLE_NODE_TOTAL} --shard=${CIRCLE_NODE_INDEX} <<# parameters.ve >>--ve<> <<# parameters.snapshots >>--ng-snapshots<> --tmpdir=/mnt/ramdisk/e2e-main - run: name: Execute CLI E2E Tests Subset with Yarn command: | mkdir /mnt/ramdisk/e2e-yarn - PATH=~/.npm-global/bin:$PATH node ./tests/legacy-cli/run_e2e --nb-shards=${CIRCLE_NODE_TOTAL} --shard=${CIRCLE_NODE_INDEX} <<# parameters.ve >>--ve<> <<# parameters.snapshots >>--ng-snapshots<> --yarn --tmpdir=/mnt/ramdisk/e2e-yarn --glob="{tests/basic/**,tests/update/**}" + node ./tests/legacy-cli/run_e2e --nb-shards=${CIRCLE_NODE_TOTAL} --shard=${CIRCLE_NODE_INDEX} <<# parameters.ve >>--ve<> <<# parameters.snapshots >>--ng-snapshots<> --yarn --tmpdir=/mnt/ramdisk/e2e-yarn --glob="{tests/basic/**,tests/update/**}" test-browsers: executor: @@ -230,8 +228,8 @@ jobs: # Waits for the Saucelabs tunnel to be ready. This ensures that we don't run tests # too early without Saucelabs not being ready. - run: ./scripts/saucelabs/wait-for-tunnel.sh - - run: PATH=~/.npm-global/bin:$PATH node ./tests/legacy-cli/run_e2e ./tests/legacy-cli/e2e/tests/misc/browsers.ts --ve - - run: PATH=~/.npm-global/bin:$PATH node ./tests/legacy-cli/run_e2e ./tests/legacy-cli/e2e/tests/misc/browsers.ts + - run: node ./tests/legacy-cli/run_e2e ./tests/legacy-cli/e2e/tests/misc/browsers.ts --ve + - run: node ./tests/legacy-cli/run_e2e ./tests/legacy-cli/e2e/tests/misc/browsers.ts - run: ./scripts/saucelabs/stop-tunnel.sh build: diff --git a/.circleci/env.sh b/.circleci/env.sh index b7b6e94a5732..d24334473255 100755 --- a/.circleci/env.sh +++ b/.circleci/env.sh @@ -15,6 +15,8 @@ echo "source $envHelpersPath;" >> $BASH_ENV; # See https://circleci.com/docs/2.0/env-vars/#built-in-environment-variables for more info. #################################################################################################### setPublicVar PROJECT_ROOT "$projectDir"; +setPublicVar NPM_CONFIG_PREFIX "${HOME}/.npm-global"; +setPublicVar PATH "${HOME}/.npm-global/bin:${PATH}"; #################################################################################################### # Define SauceLabs environment variables for CircleCI.