blob: 5bfdcf065403b48331107171fc9f4a7717806fe8 [file] [log] [blame]
load("@npm//@angular-devkit/architect-cli:index.bzl", "architect", "architect_test")
# These dependencies are needed for any ng command
filegroup(
name = "common_deps",
srcs = [
"angular.json",
"tsconfig.json",
],
visibility = ["//:__subpackages__"],
)
APPLICATION_DEPS = [
"//:common_deps",
"@npm//@angular/cli",
"@npm//@angular/core",
"@npm//@angular/router",
"@npm//@angular/platform-browser-dynamic",
"@npm//@angular-devkit/build-angular",
"@npm//rxjs",
"@npm//mime",
"@npm//zone.js",
"@npm//tslib",
"@npm//typescript",
"//projects/frontend-lib",
]
architect(
name = "build",
args = [
"frontend:build",
"--outputPath=$(@D)",
],
configuration_env_vars = ["NG_BUILD_CACHE"],
data = glob(
[
"src/**/*",
],
exclude = [
"src/**/*.spec.ts",
"src/test.ts",
],
) + APPLICATION_DEPS + [
"tsconfig.app.json",
],
output_dir = True,
)
architect(
name = "build_prod",
args = [
"frontend:build:production",
"--outputPath=$(@D)",
],
configuration_env_vars = ["NG_BUILD_CACHE"],
data = glob(
[
"src/**/*",
],
exclude = [
"src/**/*.spec.ts",
"src/test.ts",
],
) + APPLICATION_DEPS + [
"tsconfig.app.json",
],
output_dir = True,
)
architect_test(
name = "test",
args = ["frontend:test"],
configuration_env_vars = ["NG_BUILD_CACHE"],
data = glob([
"src/**/*",
]) + APPLICATION_DEPS + [
"karma.conf.js",
"tsconfig.spec.json",
"@npm//@types/jasmine",
"@npm//@types/node",
"@npm//karma",
"@npm//karma-chrome-launcher",
"@npm//karma-coverage-istanbul-reporter",
"@npm//karma-jasmine",
"@npm//karma-jasmine-html-reporter",
],
tags = [
"browser:chromium-local",
# This fails locally on macos buildkite trying to capture Chrome.
# Tested locally on OSX and it works so it is something to do with the
# buildkite osx machine chrome version/configuration.
# ==================== Test output for //:test:
# 29 01 2020 23:31:42.804:INFO [karma-server]: Karma v4.1.0 server started at http://0.0.0.0:9876/
# 29 01 2020 23:31:42.806:INFO [launcher]: Launching browsers ChromeHeadlessNoSandbox with concurrency unlimited
# 29 01 2020 23:31:42.808:INFO [launcher]: Starting browser ChromeHeadless
# 29 01 2020 23:32:42.815:WARN [launcher]: ChromeHeadless have not captured in 60000 ms, killing.
# 29 01 2020 23:32:44.818:WARN [launcher]: ChromeHeadless was not killed in 2000 ms, sending SIGKILL.
# 29 01 2020 23:32:46.822:WARN [launcher]: ChromeHeadless was not killed by SIGKILL in 2000 ms, continuing.
"no-bazelci-mac",
],
)
architect_test(
name = "e2e",
args = [
"frontend:e2e",
"--no-webdriverUpdate",
],
configuration_env_vars = ["NG_BUILD_CACHE"],
data = glob([
"src/*",
"src/**",
"e2e/*",
"e2e/**",
]) + APPLICATION_DEPS + [
"tsconfig.app.json",
"@npm//protractor",
"@npm//jasmine-spec-reporter",
"@npm//ts-node",
"@npm//@types/jasmine",
"@npm//@types/jasminewd2",
"@npm//@types/node",
],
tags = [
"browser:chromium-local",
# Fails in buildkite with this error
# [19:48:16] E/launcher - unknown error: cannot find Chrome binary
# (Driver info: chromedriver=79.0.3945.36 (3582db32b33893869b8c1339e8f4d9ed1816f143-refs/branch-heads/3945@{#614}),platform=Mac OS X 10.15.3 x86_64)
# [19:48:16] E/launcher - WebDriverError: unknown error: cannot find Chrome binary
# (Driver info: chromedriver=79.0.3945.36 (3582db32b33893869b8c1339e8f4d9ed1816f143-refs/branch-heads/3945@{#614}),platform=Mac OS X 10.15.3 x86_64)
# at Object.checkLegacyResponse
"no-bazelci-mac",
],
)
architect(
name = "lint",
args = ["frontend:lint"],
data = glob([
"src/**/*",
"e2e/src/**/*",
]) + [
"//:common_deps",
"tsconfig.spec.json",
"tsconfig.app.json",
"tslint.json",
"e2e/tsconfig.json",
"@npm//@angular/cli",
"@npm//@angular-devkit/build-angular",
"@npm//codelyzer",
"@npm//tslint",
],
)
architect(
name = "serve",
args = [
"frontend:serve",
],
configuration_env_vars = ["NG_BUILD_CACHE"],
data = glob(
[
"src/*",
"src/**",
],
exclude = [
"src/**/*.spec.ts",
"src/test.ts",
],
) + APPLICATION_DEPS + [
"tsconfig.app.json",
],
tags = ["ibazel_notify_changes"],
)
architect(
name = "serve_prod",
args = [
"frontend:serve:production",
],
configuration_env_vars = ["NG_BUILD_CACHE"],
data = glob(
[
"src/*",
"src/**",
],
exclude = [
"src/**/*.spec.ts",
"src/test.ts",
],
) + APPLICATION_DEPS + [
"tsconfig.app.json",
],
tags = ["ibazel_notify_changes"],
)
# Just a dummy test so that we have a test target for //... on certain bazelci platforms with bazel_integration_test
sh_test(
name = "dummy_test",
srcs = ["dummy_test.sh"],
)