-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d6d4bf
commit 83db957
Showing
25 changed files
with
528 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,6 @@ Visit http://localhost:8000/index.html | |
|
||
#### Docker | ||
|
||
|
||
```shell | ||
# Create an image | ||
bazel run //:tarball | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
intermediate/cpp/GPU/WebGPU/webgpu-cross-platform-app/MODULE.bazel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
""" | ||
SPDX-FileCopyrightText: 2023 Julian Amann <[email protected]> | ||
SPDX-License-Identifier: Apache-2.0 | ||
""" | ||
|
||
bazel_dep(name = "gazelle", version = "0.32.0") | ||
bazel_dep(name = "platforms", version = "0.0.7") | ||
bazel_dep(name = "rules_cc", version = "0.0.8") | ||
bazel_dep(name = "rules_go", version = "0.41.0") | ||
bazel_dep(name = "rules_oci", version = "1.3.2") | ||
bazel_dep(name = "rules_pkg", version = "0.9.1") | ||
|
||
#------------------------------------------------------------------------------------- | ||
# Go | ||
#------------------------------------------------------------------------------------- | ||
|
||
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") | ||
go_sdk.download( | ||
name = "go_sdk", | ||
version = "1.21.0", | ||
) | ||
use_repo(go_sdk, "go_sdk") | ||
|
||
register_toolchains("@go_sdk//:all") | ||
|
||
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") | ||
go_deps.from_file(go_mod = "//:go.mod") | ||
|
||
#------------------------------------------------------------------------------------- | ||
# Python | ||
#------------------------------------------------------------------------------------- | ||
|
||
bazel_dep(name = "rules_python", version = "0.25.0") | ||
|
||
python = use_extension("@rules_python//python/extensions:python.bzl", "python") | ||
use_repo(python, "python_versions") | ||
|
||
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") | ||
pip.parse( | ||
hub_name = "my_deps", | ||
python_version = "3.11", | ||
requirements_lock = "//:requirements.txt", | ||
) | ||
use_repo(pip, "my_deps") | ||
|
||
#------------------------------------------------------------------------------------- | ||
# rules_oci | ||
#------------------------------------------------------------------------------------- | ||
|
||
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci") | ||
oci.toolchains(crane_version = "v0.14.0") | ||
use_repo(oci, "oci_auth_config", "oci_crane_registry_toolchains", "oci_crane_toolchains") | ||
|
||
register_toolchains("@oci_crane_toolchains//:all", "@oci_crane_registry_toolchains//:all") | ||
|
||
oci.pull( | ||
name = "ubuntu", | ||
digest = "sha256:67211c14fa74f070d27cc59d69a7fa9aeff8e28ea118ef3babc295a0428a6d21", | ||
image = "ubuntu", | ||
platforms = [ | ||
"linux/arm64/v8", | ||
"linux/amd64", | ||
], | ||
) | ||
use_repo(oci, "ubuntu") | ||
oci.pull( | ||
name = "distroless_base", | ||
digest = "sha256:ccaef5ee2f1850270d453fdf700a5392534f8d1a8ca2acda391fbb6a06b81c86", | ||
image = "gcr.io/distroless/base", | ||
platforms = [ | ||
"linux/amd64", | ||
"linux/arm64", | ||
], | ||
) | ||
use_repo(oci, "distroless_base") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
1 change: 1 addition & 0 deletions
1
intermediate/cpp/GPU/WebGPU/webgpu-cross-platform-app/acceptance_tests/.bazelrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
common --enable_bzlmod # default in Bazel 7.0 |
1 change: 1 addition & 0 deletions
1
intermediate/cpp/GPU/WebGPU/webgpu-cross-platform-app/acceptance_tests/.bazelversion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
6.3.2 |
1 change: 1 addition & 0 deletions
1
intermediate/cpp/GPU/WebGPU/webgpu-cross-platform-app/acceptance_tests/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bazel-* |
18 changes: 18 additions & 0 deletions
18
intermediate/cpp/GPU/WebGPU/webgpu-cross-platform-app/acceptance_tests/BUILD.bazel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
load("@io_bazel_rules_webtesting//web:py.bzl", "py_web_test_suite") | ||
load("@my_deps//:requirements.bzl", "requirement") | ||
|
||
py_web_test_suite( | ||
name = "browser_test", | ||
srcs = ["browser_test.py"], | ||
browsers = [ | ||
"@io_bazel_rules_webtesting//browsers:chromium-local", | ||
], | ||
data = [ | ||
"ref_screenshot2.png", | ||
], | ||
local = True, | ||
deps = [ | ||
"@io_bazel_rules_webtesting//testing/web", | ||
requirement("imagehash"), | ||
], | ||
) |
Empty file.
21 changes: 21 additions & 0 deletions
21
intermediate/cpp/GPU/WebGPU/webgpu-cross-platform-app/acceptance_tests/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# How to run acceptance test | ||
|
||
Those test work only on a single Ubuntu 22.04 system: | ||
|
||
![works on my machine](works_on_my_machine.webp) | ||
|
||
## MacOS | ||
|
||
```bash | ||
bazel build //... # fails currently on macOS (tested on M1) - not sure why... | ||
``` | ||
|
||
## Ubuntu 22.04 | ||
|
||
```bash | ||
bazel test //... | ||
``` | ||
|
||
## References | ||
|
||
- [Bazel Web Testing Rules](https://docs-legacy.aspect.build/bazelbuild/rules_webtesting/0.3.5/readme) |
94 changes: 94 additions & 0 deletions
94
intermediate/cpp/GPU/WebGPU/webgpu-cross-platform-app/acceptance_tests/WORKSPACE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
# Python first | ||
|
||
SHA = "5868e73107a8e85d8f323806e60cad7283f34b32163ea6ff1020cf27abef6036" | ||
|
||
VERSION = "0.25.0" | ||
|
||
http_archive( | ||
name = "rules_python", | ||
sha256 = SHA, | ||
strip_prefix = "rules_python-{}".format(VERSION), | ||
url = "https://github.com/bazelbuild/rules_python/releases/download/{}/rules_python-{}.tar.gz".format(VERSION, VERSION), | ||
) | ||
|
||
load("@rules_python//python:repositories.bzl", "py_repositories") | ||
|
||
py_repositories() | ||
|
||
http_archive( | ||
name = "io_bazel_rules_webtesting", | ||
sha256 = "41d500a97ad9621dcf92fcb0cd77916e517388b196e5c3f0e63c7753e983b2bb", | ||
strip_prefix = "rules_webtesting-4d7ec75d1cbb289f977b41638fc8b630bdf22bee", | ||
urls = [ | ||
"https://github.com/bazelbuild/rules_webtesting/archive/4d7ec75d1cbb289f977b41638fc8b630bdf22bee/rules_webtesting.tar.gz", | ||
], | ||
) | ||
|
||
load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories") | ||
|
||
web_test_repositories() | ||
|
||
http_archive( | ||
name = "io_bazel_rules_go", | ||
sha256 = "278b7ff5a826f3dc10f04feaf0b70d48b68748ccd512d7f98bf442077f043fe3", | ||
urls = [ | ||
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.41.0/rules_go-v0.41.0.zip", | ||
"https://github.com/bazelbuild/rules_go/releases/download/v0.41.0/rules_go-v0.41.0.zip", | ||
], | ||
) | ||
|
||
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") | ||
|
||
go_rules_dependencies() | ||
|
||
go_register_toolchains(version = "1.20.5") | ||
|
||
http_archive( | ||
name = "bazel_gazelle", | ||
sha256 = "29218f8e0cebe583643cbf93cae6f971be8a2484cdcfa1e45057658df8d54002", | ||
urls = [ | ||
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.32.0/bazel-gazelle-v0.32.0.tar.gz", | ||
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.32.0/bazel-gazelle-v0.32.0.tar.gz", | ||
], | ||
) | ||
|
||
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") | ||
|
||
gazelle_dependencies() | ||
|
||
load("@io_bazel_rules_webtesting//web/versioned:browsers-0.3.4.bzl", "browser_repositories") | ||
|
||
browser_repositories( | ||
chromium = True, | ||
#firefox = True, | ||
#sauce = True, | ||
) | ||
|
||
load("@io_bazel_rules_webtesting//web:go_repositories.bzl", "go_internal_repositories", "go_repositories") | ||
|
||
go_repositories() | ||
|
||
go_internal_repositories() | ||
|
||
load("@io_bazel_rules_webtesting//web:py_repositories.bzl", "py_repositories") | ||
|
||
py_repositories() | ||
|
||
load("@io_bazel_rules_webtesting//web:java_repositories.bzl", "java_repositories") | ||
|
||
java_repositories() | ||
|
||
load("@rules_python//python:pip.bzl", "pip_parse") | ||
|
||
pip_parse( | ||
name = "my_deps", | ||
requirements_lock = "//:requirements.txt", | ||
) | ||
|
||
# Load the starlark macro, which will define your dependencies. | ||
load("@my_deps//:requirements.bzl", "install_deps") | ||
|
||
# Call it to define repos for your requirements. | ||
install_deps() |
Oops, something went wrong.