mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
To keep our integration tests aligned with the setup we use for the Angular repo and Components repo, we should also update the `rules_nodejs` version for our `bazel` integration test. PR Close #43138
75 lines
2.6 KiB
Text
75 lines
2.6 KiB
Text
workspace(name = "bazel_integration_test")
|
|
|
|
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
|
|
|
# Fetch rules_nodejs so we can install our npm dependencies
|
|
http_archive(
|
|
name = "build_bazel_rules_nodejs",
|
|
sha256 = "659dfa20721ff324d5e9d198d8bf3d8c74ef6563a7223d9c4974a0ca1e66dbf0",
|
|
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.0.0-rc.0/rules_nodejs-4.0.0-rc.0.tar.gz"],
|
|
)
|
|
|
|
# Fetch sass rules for compiling sass files
|
|
http_archive(
|
|
name = "io_bazel_rules_sass",
|
|
sha256 = "90efc362ad7916e4477a1ccb3e2d87c452bb9433fe81793be7acdf442962317b",
|
|
strip_prefix = "rules_sass-1.37.5",
|
|
urls = [
|
|
"https://github.com/bazelbuild/rules_sass/archive/1.37.5.zip",
|
|
"https://mirror.bazel.build/github.com/bazelbuild/rules_sass/archive/1.37.5.zip",
|
|
],
|
|
)
|
|
|
|
# Check the bazel version and download npm dependencies
|
|
load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install")
|
|
|
|
# Setup the Node.js toolchain
|
|
node_repositories(
|
|
# Use same node version as root angular WORKSPACE since
|
|
node_version = "14.16.1",
|
|
yarn_version = "1.12.1",
|
|
)
|
|
|
|
# Install our npm dependencies into @npm
|
|
yarn_install(
|
|
name = "npm",
|
|
frozen_lockfile = False,
|
|
package_json = "//:package.json",
|
|
# Turn off symlink_node_modules here as it causes flakiness with missing
|
|
# files in node_modules.
|
|
# TODO: track down the root cause of the flakiness; current suspect is that
|
|
# it is an issue with managed_directories when resources are limited
|
|
symlink_node_modules = False,
|
|
yarn_lock = "//:yarn.lock",
|
|
)
|
|
|
|
# Load protractor dependencies
|
|
load("@npm//@bazel/protractor:package.bzl", "npm_bazel_protractor_dependencies")
|
|
|
|
npm_bazel_protractor_dependencies()
|
|
|
|
# Setup the rules_webtesting toolchain
|
|
load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories")
|
|
|
|
web_test_repositories()
|
|
|
|
load("@io_bazel_rules_webtesting//web/versioned:browsers-0.3.2.bzl", "browser_repositories")
|
|
|
|
browser_repositories(
|
|
chromium = True,
|
|
firefox = True,
|
|
)
|
|
|
|
# Setup the rules_sass toolchain
|
|
load("@io_bazel_rules_sass//:defs.bzl", "sass_repositories")
|
|
|
|
# TODO(devversion): remove workaround once `rules_sass` supports v4 of the Bazel NodeJS rules.
|
|
# For now, we ust replicate the original `sass_repositories` call and manually add the
|
|
# `--ignore-scripts` Yarn argument to not run the postinstall version check of `@bazel/worker`
|
|
yarn_install(
|
|
name = "build_bazel_rules_sass_deps",
|
|
package_json = "@io_bazel_rules_sass//sass:package.json",
|
|
yarn_lock = "@io_bazel_rules_sass//sass:yarn.lock",
|
|
symlink_node_modules = False,
|
|
args = ["--ignore-scripts"],
|
|
)
|