From e5cdd3397da57030f26de185cd5cd124063d092a Mon Sep 17 00:00:00 2001 From: AleksanderBodurri Date: Tue, 30 Nov 2021 23:41:58 -0500 Subject: [PATCH] ci: add labels to angular devtools ci tasks This commit also cleans up the .bazelrc file in the devtools directory --- .circleci/config.yml | 24 ++++++++++++++++++------ devtools/.bazelrc | 24 ------------------------ devtools/package.json | 11 ++++++----- 3 files changed, 24 insertions(+), 35 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d30dd93f410..862fb7aa4ae 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -739,12 +739,24 @@ jobs: steps: - custom_attach_workspace - init_environment - - run: sudo apt-get update - - run: sudo apt-get -y install libgtk-3-0 libasound2 libnss3 libxss1 libdrm2 libgbm-dev libxshmfence-dev libgtk2.0-0 libnotify-dev libgconf-2-4 libxtst6 xauth xvfb - - run: yarn --cwd devtools install --frozen-lockfile --non-interactive --cache-folder ~/.cache/yarn - - run: yarn --cwd devtools test:ci - - run: yarn --cwd devtools build:chrome - - run: yarn --cwd devtools cy:ci + - run: + name: Sync package index files + command: sudo apt-get update + - run: + name: Install Karma and Cypress dependencies + command: sudo apt-get -y install libgtk-3-0 libasound2 libnss3 libxss1 libdrm2 libgbm-dev libxshmfence-dev libgtk2.0-0 libnotify-dev libgconf-2-4 libxtst6 xauth xvfb + - run: + name: Install DevTools dependencies + command: yarn --cwd devtools install --frozen-lockfile --non-interactive --cache-folder ~/.cache/yarn + - run: + name: Run unit tests + command: yarn --cwd devtools test:ci + - run: + name: Test production build + command: yarn --cwd devtools build:chrome:ci + - run: + name: Run e2e tests + command: yarn --cwd devtools cy:ci workflows: version: 2 diff --git a/devtools/.bazelrc b/devtools/.bazelrc index 09a40ac53ea..fee53071f79 100644 --- a/devtools/.bazelrc +++ b/devtools/.bazelrc @@ -1,27 +1,3 @@ -# These options are enabled when running on CI -# We do this by copying this file to /etc/bazel.bazelrc at the start of the build. -# See documentation in /docs/BAZEL.md - -# Import config items common to both Linux and Windows setups. -# https://docs.bazel.build/versions/master/guide.html#bazelrc-syntax-and-semantics -try-import %workspace%/.circleci/bazel.common.rc - -# Save downloaded repositories in a location that can be cached by CircleCI. This helps us -# speeding up the analysis time significantly with Bazel managed node dependencies on the CI. -build --repository_cache=/home/circleci/bazel_repository_cache - -# Workaround https://github.com/bazelbuild/bazel/issues/3645 -# Bazel doesn't calculate the memory ceiling correctly when running under Docker. -# Limit Bazel to consuming resources that fit in CircleCI "xlarge" class -# https://circleci.com/docs/2.0/configuration-reference/#resource_class -build --local_cpu_resources=20 -build --local_ram_resources=32768 - -# All build executed remotely should be done using our RBE configuration. -build:remote --google_default_credentials - -build --config=remote - import ../.bazelrc build --flag_alias=partial_compilation=@npm//@angular/bazel/src:partial_compilation diff --git a/devtools/package.json b/devtools/package.json index 1ded1830dd4..b27ec16a2fe 100644 --- a/devtools/package.json +++ b/devtools/package.json @@ -6,11 +6,11 @@ "ng": "ng", "cypress:verify": "cypress verify", "start": "ibazel run src:devserver", - "start-no-animations": "bazel run src:devserver-e2e", - "build:chrome": "bazel build projects/shell-chrome/src:prodapp", + "start-no-animations": "bazelisk run src:devserver-e2e", + "build:chrome": "bazelisk build projects/shell-chrome/src:prodapp", "build:chrome:watch": "ibazel build projects/shell-chrome/src:prodapp", "release": "node projects/shell-chrome/set-version.js && build:chrome", - "test": "bazelisk test ...", + "test": "bazelisk test //...", "lint": "tslint -p tsconfig.json -c tslint.json", "lint:fix": "tslint -p tsconfig.json -c tslint.json --fix", "e2e": "yarn cy:run", @@ -18,9 +18,10 @@ "cy:version": "$(yarn bin)/cypress version", "cy:run": "yarn cypress run", "cy:open": "yarn cypress open", - "cy:ci": "start-server-and-test start http-get://localhost:4200 cy:run", "cy:watch": "start-server-and-test start http-get://localhost:4200 cy:open", - "test:ci": "bazelisk test //...", + "cy:ci": "start-server-and-test start http-get://localhost:4200 cy:run", + "test:ci": "bazelisk --bazelrc=../.circleci/bazel.linux.rc test //...", + "build:chrome:ci": "bazelisk build projects/shell-chrome/src:prodapp", "prettier": "prettier --write \"{,!(node_modules|dist|build|coverage)/**/}*.{js,jsx,ts,tsx,json}\"", "prettier:fix": "pretty-quick --staged" },