From 8679988b6c6989affd330ab07dc924c164b0202e Mon Sep 17 00:00:00 2001 From: Paul Meyer <49727155+katexochen@users.noreply.github.com> Date: Tue, 14 Mar 2023 07:23:11 +0000 Subject: [PATCH] fixup! bazel: add tidy and check Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com> --- .github/workflows/test-tidy.yml | 10 +++++----- BUILD.bazel | 1 + bazel/ci/BUILD.bazel | 2 +- bazel/toolchains/multirun_deps.bzl | 9 +++++---- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test-tidy.yml b/.github/workflows/test-tidy.yml index 2e193160b..d5cd8d234 100644 --- a/.github/workflows/test-tidy.yml +++ b/.github/workflows/test-tidy.yml @@ -34,10 +34,6 @@ jobs: shell: bash run: bazelisk run //:tidy - - name: Run Bazel check - shell: bash - run: bazelisk run //:check - - name: Check if tidy made modifications id: tidycheck shell: bash @@ -52,9 +48,13 @@ jobs: ${diff} \`\`\` EOF - echo "::error::The repo is not tidy. Please run 'bazel run bazel/ci:tidy' and commit the changes." + echo "::error::The repo is not tidy. Please run 'bazel run //:tidy' and commit the changes." exit 1 + - name: Run Bazel check + shell: bash + run: bazelisk run //:check + # The following steps are only executed if the previous tidy check failed # and the action runs on an renovat branche. In this case, we tidy all # modules again and commit the changes, so the user doesn't need to do it. diff --git a/BUILD.bazel b/BUILD.bazel index 54250a4d1..8dcb77271 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -16,5 +16,6 @@ alias( actual = "//bazel/ci:check", ) +# These magic Gazelle commands need to be in the top-level BUILD file. # gazelle:map_kind go_test go_test //bazel/go:go_test.bzl # gazelle:prefix github.com/edgelesssys/constellation/v2 diff --git a/bazel/ci/BUILD.bazel b/bazel/ci/BUILD.bazel index 38fc244d3..526533fbf 100644 --- a/bazel/ci/BUILD.bazel +++ b/bazel/ci/BUILD.bazel @@ -65,12 +65,12 @@ sh_template( multirun( name = "tidy", commands = [ - # execute sequentially ":go_mod_tidy", ":gazelle_update_repos", ":gazelle_generate", ":buildifier_fix", ], + jobs = 1, # execute sequentially visibility = ["//visibility:public"], ) diff --git a/bazel/toolchains/multirun_deps.bzl b/bazel/toolchains/multirun_deps.bzl index e5989f800..270bfe3cd 100644 --- a/bazel/toolchains/multirun_deps.bzl +++ b/bazel/toolchains/multirun_deps.bzl @@ -1,10 +1,11 @@ """multirun_deps""" -load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") def multirun_deps(): - git_repository( + http_archive( name = "com_github_ash2k_bazel_tools", - commit = "4e045b9b4e3e613970ab68941b556a356239d433", - remote = "https://github.com/ash2k/bazel-tools.git", + sha256 = "0ad31a16c9e48b01a1a11daf908227a6bf6106269187cccf7398625fea2ba45a", + strip_prefix = "bazel-tools-4e045b9b4e3e613970ab68941b556a356239d433", + url = "https://github.com/ash2k/bazel-tools/archive/4e045b9b4e3e613970ab68941b556a356239d433.tar.gz", )