Skip to content

Commit

Permalink
Merge pull request #16 from fasterci/ap/bzlmod
Browse files Browse the repository at this point in the history
Ap/bzlmod
  • Loading branch information
apesternikov authored Feb 21, 2024
2 parents af2cbd4 + 35938ec commit ba14f91
Show file tree
Hide file tree
Showing 563 changed files with 7,951 additions and 896 deletions.
2 changes: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
common --enable_bzlmod
build --nolegacy_external_runfiles
build --verbose_failures
build --@io_bazel_rules_go//go/config:pure
test --test_output=errors

2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.3.2
7.0.2
20 changes: 15 additions & 5 deletions .fasterci/config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
workflows:

- &build_workflow
name: Faster CI / build (6.1.0)
env:
USE_BAZEL_VERSION: "6.1.0"
name: Faster CI / build (default bazel ver)
on:
push:
branches:
Expand All @@ -27,8 +25,20 @@ workflows:
- //...
test_flags:
- --test_size_filters=-large,-enormous
- name: Build & test e2e with bzlmod
working-directory: e2e
bazel:
build_targets:
- //...
build_flags:
- --config=bzlmod
test_targets:
- //...
test_flags:
- --config=bzlmod
- --test_size_filters=-large,-enormous

- <<: *build_workflow
name: Faster CI / build (6.3.2)
name: Faster CI / build (6.5.0)
env:
USE_BAZEL_VERSION: "6.3.2"
USE_BAZEL_VERSION: "6.5.0"
16 changes: 2 additions & 14 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
# gazelle:proto disable_global

load("@bazel_gazelle//:def.bzl", "gazelle")
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier", "buildifier_test")
load("@buildifier_prebuilt//:rules.bzl", "buildifier")

licenses(["notice"]) # Apache 2.0

exports_files(["WORKSPACE"])

# gazelle:prefix github.com/adobe/rules_gitops
# gazelle:prefix github.com/fasterci/rules_gitops
gazelle(
name = "gazelle",
build_tags = [
Expand Down Expand Up @@ -49,15 +49,3 @@ buildifier(
name = "buildifier-fix",
lint_mode = "fix",
)

buildifier_test(
name = "buildifier_check",
lint_mode = "warn",
lint_warnings = [
"-module-docstring",
"-function-docstring",
"-function-docstring-header",
"-function-docstring-args",
"-function-docstring-return",
],
)
51 changes: 51 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
module(
name = "rules_gitops",
version = "0.50.0",
)

bazel_dep(name = "aspect_bazel_lib", version = "2.4.1")
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "platforms", version = "0.0.8")
bazel_dep(name = "rules_oci", version = "1.7.2")
bazel_dep(name = "rules_pkg", version = "0.9.1")
bazel_dep(name = "rules_go", version = "0.46.0", repo_name = "io_bazel_rules_go")

go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.21.5")

bazel_dep(name = "gazelle", version = "0.35.0", repo_name = "bazel_gazelle")

go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
use_repo(
go_deps,
"com_github_ghodss_yaml",
"com_github_golang_protobuf",
"com_github_google_go_cmp",
"com_github_google_go_github_v32",
"com_github_xanzy_go_gitlab",
"io_k8s_api",
"io_k8s_apimachinery",
"io_k8s_client_go",
"org_golang_x_oauth2",
)

toolchains = use_extension(
"@rules_gitops//gitops:extensions.bzl",
"toolchains",
)
toolchains.kustomize()
use_repo(toolchains, "kustomize_bin", "kustomize_toolchains")

register_toolchains("@kustomize_toolchains//:all")

# Uncomment this part when bazel 6 is deprecated. Supported in bazel 7
# kubeconfig = use_repo_rule("@rules_gitops//skylib:k8s.bzl", "kubeconfig")

# kubeconfig(
# name = "k8s_test",
# cluster = "mycluster",
# use_host_config = True,
# )

bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)
Loading

0 comments on commit ba14f91

Please sign in to comment.