ci: teardown CircleCI configuration
diff --git a/.circleci/bazel.rc b/.circleci/bazel.rc deleted file mode 100644 index 336d5e6..0000000 --- a/.circleci/bazel.rc +++ /dev/null
@@ -1,32 +0,0 @@ -# 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. - -# Don't be spammy in the logs -build --noshow_progress - -# Keep going on failures so that we see all failures no CI and not just the first -# and so that we see everything that passes as well -build --keep_going - -# Print all the options that apply to the build. -# This helps us diagnose which options override others -# (e.g. /etc/bazel.bazelrc vs. tools/bazel.rc) -build --announce_rc - -# 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_ram_resources=14336 -build --local_cpu_resources=8 - -# Our integration tests rely on accessing public registries which can fail -# Let's give all failing tests a second try to mostly paper over flakiness -test --flaky_test_attempts=2 - -# Expose the SSH_AUTH_SOCK variable to integration tests that need to run git_repository repository rules -# This is needed by the CircleCI git-over-ssh environment -test --test_env=SSH_AUTH_SOCK - -# Keep going after first failure -build --keep_going
diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 033d284..0000000 --- a/.circleci/config.yml +++ /dev/null
@@ -1,187 +0,0 @@ -# Configuration file for https://circleci.com/gh/bazelbuild/rules_nodejs - -# Note: YAML anchors allow an object to be re-used, reducing duplication. -# The ampersand declares an alias for an object, then later the `<<: *name` -# syntax dereferences it. -# See http://blog.daemonl.com/2016/02/yaml.html -# To validate changes, use an online parser, eg. -# http://yaml-online-parser.appspot.com/ - -## IMPORTANT -# If you change the `default_docker_image` version, also change the `cache_key` version -var_1: &default_docker_image circleci/node:12.22.7 -var_2: &browsers_docker_image circleci/node:12.22.7-browsers -var_3: &cache_key node-12.18.3-{{ checksum "yarn.lock" }} - -var_4: &init_environment - run: - name: Initializing environment (setting up variables, overwriting Yarn) - command: | - # Setup circleci environment - ./.circleci/env.sh - - sudo apt-get update - # Install GTK+ graphical user interface (libgtk-3-0), advanced linux sound architecture (libasound2) - # and network security service libraries (libnss3) & X11 Screen Saver extension library (libssx1) - # which are dependendies of chrome & needed for karma & protractor headless chrome tests. - # This is a very small install with the whole init_environment step taking less than 8 seconds. - # TODO(gregmagolan): switch rules_webtesting to use a chrome headless_shell binary which does - # not depend on any dynamically linked libs - sudo apt-get -y install libgtk-3-0 libasound2 libnss3 libxss1 - # Also install libraries required for firefox - sudo apt-get -y install libdbus-glib-1-2 - - # Overwrite the yarn installed in the docker container with our own version. - pathToYarn=$(realpath ./third_party/github.com/yarnpkg/yarn/releases/download/v1.13.0/bin/yarn.js) - sudo chmod a+x $pathToYarn - sudo ln -fs $pathToYarn /usr/local/bin/yarn - echo "Yarn version: $(yarn --version)" - - # Add GitHub to known hosts. - mkdir -p ~/.ssh - echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' >> ~/.ssh/known_hosts - - # Use git+ssh instead of https - git config --global url."ssh://git@github.com".insteadOf "https://github.com" || true - git config --global gc.auto 0 || true - - # Setup /etc/bazel.bazelrc - sudo cp .circleci/bazel.rc /etc/bazel.bazelrc - -var_5: &yarn_install - run: - name: Run yarn install - command: yarn install - -var_6: &init_bazel - run: - name: Initializing Bazel - command: | - # Symlink fetched bazelisk to /usr/local/bin/bazel - pathToBazel=$(realpath ./node_modules/@bazel/bazelisk/bazelisk-linux_amd64) - sudo ln -fs $pathToBazel /usr/local/bin/bazel - echo "Bazel version:" - bazel version - -var_7: &hide_node_and_yarn_local_binaries - run: - name: Hide node, npm, and yarn binaries - command: | - # Hide node binaries to enforce that Bazel uses only the hermetic ones it downloads - sudo mv /usr/local/bin/node /usr/local/bin/node_ - sudo mv /usr/local/bin/npm /usr/local/bin/npm_ - sudo mv /usr/local/bin/yarn /usr/local/bin/yarn_ - -var_9: &job_defaults - working_directory: ~/rules_nodejs - docker: - - image: *default_docker_image - -var_10: &restore_cache - restore_cache: - keys: - - *cache_key - -var_11: &attach_workspace - attach_workspace: - at: ~/ - -# Opt-in to the new goodness -version: 2 - -# These jobs will run in parallel, and report separate statuses to GitHub PRs -jobs: - setup: - <<: *job_defaults - steps: - - checkout - - *restore_cache - - *init_environment - - *yarn_install - - *init_bazel - - # Run yarn - - run: bazel run @yarn//:yarn - - # Save all node_modules to the cache - - save_cache: - key: *cache_key - paths: - - "node_modules" - - # Persist any changes at this point to be reused by further jobs. - - persist_to_workspace: - root: ~/ - paths: - - ./rules_nodejs - - # Overlaps with testing we do on BuildKite. This is still here because: - # - BuildKite doesn't have a public results UI; failures here let contributors fix their changes - # - We hide the node,yarn,npm binaries here which we don't do on BuildKite - # TODO: port these assertions to BuildKite - test: - <<: *job_defaults - resource_class: xlarge - steps: - - *attach_workspace - - *init_environment - - *init_bazel - - *hide_node_and_yarn_local_binaries - - - run: bazel test --test_tag_filters=-e2e,-examples ... - - - store_artifacts: - path: dist/bin/release.tar.gz - destination: release.tar.gz - - test_integration: - <<: *job_defaults - docker: - # Needed because some tests such as examples/angular_bazel_architect - # require local chrome - - image: *browsers_docker_image - resource_class: xlarge - # We need to reduce the memory & CPU usage of the top-level - # bazel process for this large bazel-in-bazel test to not - # deplete the system memory completely. - # - startup JVM memory reduced - # - top-level bazel process should use as little memory as possible and only 1 core - # - nested bazel process should have its memory & core optimally capped as well - parallelism: 8 - steps: - - *attach_workspace - - *init_environment - - run: - name: Tune top-level bazel JVM memory usage - command: echo 'startup --host_jvm_args=-Xms256m --host_jvm_args=-Xmx1280m' >> .bazelrc - - *init_bazel - - *hide_node_and_yarn_local_binaries - - run: - command: ./.circleci/run_integration_tests.sh ${CIRCLE_NODE_INDEX} ${CIRCLE_NODE_TOTAL} - no_output_timeout: 30m - - test_integration_manual: - <<: *job_defaults - steps: - - *attach_workspace - - *init_environment - - *init_bazel - # Additional integration assertions that can only be done manually - - run: cd e2e/symlinked_node_modules_npm && yarn test && bazel clean - - run: cd e2e/symlinked_node_modules_yarn && yarn test && bazel clean - - run: cd examples/from_source && bazel test //... - -workflows: - version: 2 - default_workflow: - jobs: - - setup - - test: - requires: - - setup - - test_integration: - requires: - - setup - - test_integration_manual: - requires: - - setup
diff --git a/.circleci/env-helpers.inc.sh b/.circleci/env-helpers.inc.sh deleted file mode 100644 index ff21eb9..0000000 --- a/.circleci/env-helpers.inc.sh +++ /dev/null
@@ -1,38 +0,0 @@ -#################################################################################################### -# Helpers for defining environment variables for CircleCI. -# -# In CircleCI, each step runs in a new shell. The way to share ENV variables across steps is to -# export them from `$BASH_ENV`, which is automatically sourced at the beginning of every step (for -# the default `bash` shell). -# -# See also https://circleci.com/docs/2.0/env-vars/#using-bash_env-to-set-environment-variables. -#################################################################################################### - -# Set and print an environment variable. -# -# Use this function for setting environment variables that are public, i.e. it is OK for them to be -# visible to anyone through the CI logs. -# -# Usage: `setPublicVar <name> <value>` -function setPublicVar() { - setSecretVar $1 "$2"; - echo "$1=$2"; -} - -# Set (without printing) an environment variable. -# -# Use this function for setting environment variables that are secret, i.e. should not be visible to -# everyone through the CI logs. -# -# Usage: `setSecretVar <name> <value>` -function setSecretVar() { - # WARNING: Secrets (e.g. passwords, access tokens) should NOT be printed. - # (Keep original shell options to restore at the end.) - local -r originalShellOptions=$(set +o); - set +x -eu -o pipefail; - - echo "export $1=\"${2:-}\";" >> $BASH_ENV; - - # Restore original shell options. - eval "$originalShellOptions"; -}
diff --git a/.circleci/env.sh b/.circleci/env.sh deleted file mode 100755 index a9e24c2..0000000 --- a/.circleci/env.sh +++ /dev/null
@@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -# Variables -readonly projectDir=$(realpath "$(dirname ${BASH_SOURCE[0]})/..") -readonly envHelpersPath="$projectDir/.circleci/env-helpers.inc.sh"; - -# Load helpers and make them available everywhere (through `$BASH_ENV`). -source $envHelpersPath; -echo "source $envHelpersPath;" >> $BASH_ENV; - -#################################################################################################### -# Define PUBLIC environment variables for CircleCI. -#################################################################################################### -# ChromeDriver version compatible with the Chrome version included in the docker image used in -# `.circleci/config.yml`. See http://chromedriver.chromium.org/downloads for a list of versions. -# This variable is intended to be passed as an arg to the `webdriver-manager update` command (e.g. -# `"postinstall": "webdriver-manager update $CHROMEDRIVER_VERSION_ARG"`). -setPublicVar CHROMEDRIVER_VERSION_ARG "--versions.chrome 75.0.3770.90"; - -# Source `$BASH_ENV` to make the variables available immediately. -source $BASH_ENV;
diff --git a/.circleci/run_integration_tests.sh b/.circleci/run_integration_tests.sh deleted file mode 100755 index 00bf0b2..0000000 --- a/.circleci/run_integration_tests.sh +++ /dev/null
@@ -1,36 +0,0 @@ -#!/usr/bin/env bash - -set -eu -o pipefail -# -e: exits if a command fails -# -u: errors if an variable is referenced before being set -# -o pipefail: causes a pipeline to produce a failure return code if any command errors - -readonly SHARD_INDEX=${1:-0} -readonly MAX_SHARDS=${2:-1} - -# Get a sorted list of all test targets. We sort to ensure that each shard gets the same list -# incase there is any inconstencies with bazel query on different shards. -readonly QUERY_RESULT=$(bazel query 'kind("bazel_integration_test", //examples/... union //e2e/...) except attr("tags", "no-circleci", //examples/... union //e2e/...)') -declare TEST_TARGETS_ARRAY=() -for target in ${QUERY_RESULT}; do - TEST_TARGETS_ARRAY+=("${target}") -done -IFS=$'\n' -TEST_TARGETS=($(sort <<<"${TEST_TARGETS_ARRAY[*]}")) -unset IFS - -# Get the list of test targets for this shard -declare s=${SHARD_INDEX} -declare SHARD_TARGETS=() -for target in ${TEST_TARGETS[@]:-}; do - if (( ${s} % ${MAX_SHARDS} == 0 )); then - SHARD_TARGETS+=("${target}") - fi - ((s=s+1)) -done - -# Run integration tests -echo "Shard index ${SHARD_INDEX} of ${MAX_SHARDS} shards" -echo "Targets: ${SHARD_TARGETS[@]:-}" -echo -bazel test --local_ram_resources=792 --test_arg=--local_ram_resources=13312 --test_arg=--local_cpu_resources=7 ${SHARD_TARGETS[@]:-} --test_output=streamed