Skip to content

Commit 8a88493

Browse files
committed
add bazel config file
1 parent 6188942 commit 8a88493

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

.github/workflows/bazel.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Bazel files check
2+
3+
permissions: read-all
4+
5+
on:
6+
push:
7+
branches:
8+
- master
9+
paths:
10+
- '*.bazel'
11+
- '*.bzl'
12+
pull_request:
13+
paths:
14+
- '*.bazel'
15+
- '*.bzl'
16+
17+
jobs:
18+
check:
19+
name: Validate formatting
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v3
23+
24+
- name: Setup buildifier
25+
uses: jbajic/setup-buildifier@v1
26+
with:
27+
buildifier-version: '7.3.1'
28+
29+
- name: Run buildifier
30+
run: |
31+
buildifier -mode check -r .

BUILD.bazel

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Bazel support is added to enable projects that use Bazel to easily
2+
# access the test suite, and file groups without having the need to float
3+
# a patch on top of WPT.
4+
#
5+
# In order to iterate over the files inside a subfolder of WPT, we expose
6+
# the globs in the `tests.bzl` file.
7+
#
8+
# In order to format and lint a bazel file, you can use the following command:
9+
# > buildifier -mode=check BUILD.bazel tests.bzl
10+
load("//:tests.bzl", "directories")
11+
12+
[filegroup(
13+
name = dir,
14+
srcs = glob(["{}/**/*".format(dir)]),
15+
visibility = ["//visibility:public"],
16+
) for dir in directories]

tests.bzl

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This excludes all folders that start with `.` annotation to remove folders like `.github`
2+
directories = glob(["*"], exclude_directories = 0, exclude = glob(["*", ".*"], exclude_directories = 1))
3+
4+
TEST_GROUPS = {
5+
name: glob([name + "/**/*"])
6+
for name in directories
7+
}

0 commit comments

Comments
 (0)