From 2cfa872818f1d09453aea0f66879e7a05014bd2d Mon Sep 17 00:00:00 2001 From: Robin Linden Date: Fri, 28 Jan 2022 00:38:58 +0100 Subject: [PATCH] Add a Bazel Buildifier CI job --- .github/workflows/ci.yml | 10 ++++++++++ auto_tests/BUILD.bazel | 4 ++-- other/fun/BUILD.bazel | 15 ++++++++++++--- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77eeb29c..a0bec11a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -153,3 +153,13 @@ jobs: -lpthread $(pkg-config --cflags --libs libsodium opus vpx) - name: Run the test run: "./send_message_test | grep 'tox clients connected'" + + buildifier: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Check + run: | + wget --no-verbose --output-document=buildifier https://github.com/bazelbuild/buildtools/releases/download/4.2.5/buildifier-linux-amd64 + sudo chmod +x buildifier + ./buildifier --lint=warn --warnings=all -mode diff $(find . -type f -name BUILD.bazel) diff --git a/auto_tests/BUILD.bazel b/auto_tests/BUILD.bazel index 000b8ee9..5838cb77 100644 --- a/auto_tests/BUILD.bazel +++ b/auto_tests/BUILD.bazel @@ -16,9 +16,9 @@ cc_library( deps = [ ":check_compat", "//c-toxcore/testing:misc_tools", + "//c-toxcore/toxcore", "//c-toxcore/toxcore:Messenger", "//c-toxcore/toxcore:mono_time", - "//c-toxcore/toxcore", ], ) @@ -40,8 +40,8 @@ flaky_tests = { False, ), deps = [ - ":check_compat", ":auto_test_support", + ":check_compat", "//c-toxcore/testing:misc_tools", "//c-toxcore/toxav", "//c-toxcore/toxcore", diff --git a/other/fun/BUILD.bazel b/other/fun/BUILD.bazel index 99ee50f7..3be235c7 100644 --- a/other/fun/BUILD.bazel +++ b/other/fun/BUILD.bazel @@ -28,7 +28,10 @@ cc_binary( cc_binary( name = "create_minimal_savedata", testonly = 1, - srcs = ["create_minimal_savedata.c", "create_common.h"], + srcs = [ + "create_common.h", + "create_minimal_savedata.c", + ], deps = [ "//c-toxcore/toxcore:ccompat", "@libsodium", @@ -38,7 +41,10 @@ cc_binary( cc_binary( name = "create_savedata", testonly = 1, - srcs = ["create_savedata.c", "create_common.h"], + srcs = [ + "create_common.h", + "create_savedata.c", + ], deps = [ "//c-toxcore/toxcore", "//c-toxcore/toxcore:ccompat", @@ -49,7 +55,10 @@ cc_binary( cc_binary( name = "create_bootstrap_keys", testonly = 1, - srcs = ["create_bootstrap_keys.c", "create_common.h"], + srcs = [ + "create_bootstrap_keys.c", + "create_common.h", + ], deps = [ "//c-toxcore/toxcore:ccompat", "@libsodium",