Skip to content

Commit

Permalink
test: test node_repositories cross compile with rules_docker nodejs_i…
Browse files Browse the repository at this point in the history
…mage
  • Loading branch information
gregmagolan committed Jul 16, 2019
1 parent 38c810f commit 0e646a3
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 1 deletion.
26 changes: 25 additions & 1 deletion .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
platforms:
tasks:
ubuntu1604:
name: ubuntu1604
platform: ubuntu1604
run_targets:
- "@nodejs//:yarn"
- "//internal/node/test:no_deps"
Expand All @@ -18,6 +20,8 @@ platforms:
test_targets:
- "//..."
ubuntu1804:
name: ubuntu1804
platform: ubuntu1804
run_targets:
- "@nodejs//:yarn"
- "//internal/node/test:no_deps"
Expand All @@ -38,6 +42,8 @@ platforms:
test_targets:
- "//..."
macos:
name: macos
platform: macos
run_targets:
- "@nodejs//:yarn"
- "//internal/node/test:no_deps"
Expand All @@ -54,7 +60,16 @@ platforms:
- "//..."
test_targets:
- "//..."
macos_cross_compile:
name: macos_cross_compile
platform: macos
build_flags:
- "--platforms=@build_bazel_rules_nodejs//toolchains/node:linux_amd64"
build_targets:
- "//internal/e2e/nodejs_image:docker"
windows:
name: windows
platform: windows
run_targets:
- "@nodejs//:yarn"
- "//internal/node/test:no_deps"
Expand All @@ -73,6 +88,15 @@ platforms:
- "--test_tag_filters=-fix-windows"
test_targets:
- "//..."
windows_cross_compile:
name: windows_cross_compile
platform: windows
build_flags:
- "--platforms=@build_bazel_rules_nodejs//toolchains/node:linux_amd64"
build_targets:
- "//internal/e2e/nodejs_image:docker"
rbe_ubuntu1604:
name: rbe_ubuntu1604
platform: rbe_ubuntu1604
build_targets:
- "//..."
14 changes: 14 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@ load("@internal_e2e_packages//:setup_workspace.bzl", "internal_e2e_packages_setu

internal_e2e_packages_setup_workspace()

load(
"@io_bazel_rules_docker//repositories:repositories.bzl",
container_repositories = "repositories",
)

container_repositories()

load(
"@io_bazel_rules_docker//nodejs:image.bzl",
nodejs_image_repositories = "repositories",
)

nodejs_image_repositories()

# Dependencies to run skydoc
load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories")

Expand Down
8 changes: 8 additions & 0 deletions internal/e2e/nodejs_image/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
load("@io_bazel_rules_docker//nodejs:image.bzl", "nodejs_image")

# bazel build --platforms=@build_bazel_rules_nodejs//toolchains/node:linux_amd64 //internal/e2e/nodejs_image:docker
nodejs_image(
name = "docker",
entry_point = ":main.js",
node_modules = "@npm//:node_modules",
)
1 change: 1 addition & 0 deletions internal/e2e/nodejs_image/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log('hello world')
8 changes: 8 additions & 0 deletions package.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ def rules_nodejs_dev_dependencies():
strip_prefix = "rules_sass-86ca977cf2a8ed481859f83a286e164d07335116",
)

# For test coverage
http_archive(
name = "io_bazel_rules_docker",
sha256 = "87fc6a2b128147a0a3039a2fd0b53cc1f2ed5adb8716f50756544a572999ae9a",
strip_prefix = "rules_docker-0.8.1",
urls = ["https://github.com/bazelbuild/rules_docker/archive/v0.8.1.tar.gz"],
)

# Needed for stardoc
http_archive(
name = "io_bazel",
Expand Down

0 comments on commit 0e646a3

Please sign in to comment.