Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add bazel config file #48084

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Bazel files check

permissions: read-all

on:
push:
branches:
- master
paths:
- '*.bazel'
- '*.bzl'
pull_request:
paths:
- '*.bazel'
- '*.bzl'

jobs:
check:
name: Validate formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup buildifier
uses: jbajic/setup-buildifier@v1
with:
buildifier-version: '7.3.1'

- name: Run buildifier
run: |
buildifier -mode check -r .
16 changes: 16 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Bazel support is added to enable projects that use Bazel to easily
# access the test suite, and file groups without having the need to float
# a patch on top of WPT.
#
# In order to iterate over the files inside a subfolder of WPT, we expose
# the globs in the `tests.bzl` file.
#
# In order to format and lint a bazel file, you can use the following command:
# > buildifier -mode=check BUILD.bazel tests.bzl
load("//:tests.bzl", "directories")

[filegroup(
name = dir,
srcs = glob(["{}/**/*".format(dir)]),
visibility = ["//visibility:public"],
) for dir in directories]
7 changes: 7 additions & 0 deletions tests.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This excludes all folders that start with `.` annotation to remove folders like `.github`
directories = glob(["*"], exclude_directories = 0, exclude = glob(["*", ".*"], exclude_directories = 1))

TEST_GROUPS = {
name: glob([name + "/**/*"])
for name in directories
}
Loading