diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index c3b1c51f47..0baec7ba0f 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -1,6 +1,8 @@ --- -platforms: +tasks: ubuntu1604: + name: ubuntu1604 + platform: ubuntu1604 run_targets: - "@nodejs//:yarn" - "//internal/node/test:no_deps" @@ -18,6 +20,8 @@ platforms: test_targets: - "//..." ubuntu1804: + name: ubuntu1804 + platform: ubuntu1804 run_targets: - "@nodejs//:yarn" - "//internal/node/test:no_deps" @@ -38,6 +42,8 @@ platforms: test_targets: - "//..." macos: + name: macos + platform: macos run_targets: - "@nodejs//:yarn" - "//internal/node/test:no_deps" @@ -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" @@ -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: - "//..." diff --git a/WORKSPACE b/WORKSPACE index 008cb97d25..9f52f1e457 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -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") diff --git a/internal/e2e/nodejs_image/BUILD.bazel b/internal/e2e/nodejs_image/BUILD.bazel new file mode 100644 index 0000000000..582ef196c6 --- /dev/null +++ b/internal/e2e/nodejs_image/BUILD.bazel @@ -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", +) diff --git a/internal/e2e/nodejs_image/main.js b/internal/e2e/nodejs_image/main.js new file mode 100644 index 0000000000..c9cd42ff26 --- /dev/null +++ b/internal/e2e/nodejs_image/main.js @@ -0,0 +1 @@ +console.log('hello world') \ No newline at end of file diff --git a/package.bzl b/package.bzl index ba820150e7..2afdbafb7d 100644 --- a/package.bzl +++ b/package.bzl @@ -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",