Skip to content

Commit

Permalink
Fix bazel build update deps (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcushines committed Apr 19, 2024
1 parent b2bb90d commit 2f295bc
Show file tree
Hide file tree
Showing 13 changed files with 827 additions and 160 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: "bazel build"
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "0 0 * * *"
jobs:
build:
runs-on: ubuntu-latest
env:
BAZEL: bazelisk-linux-amd64
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Mount bazel cache
uses: actions/cache@v4
with:
# See https://docs.bazel.build/versions/master/output_directories.html
path: "~/.cache/bazel"
# Create a new cache entry whenever Bazel files change.
# See https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
key: bazel-${{ runner.os }}-build-${{ hashFiles('**/*.bzl', '**/*.bazel') }}
restore-keys: |
bazel-${{ runner.os }}-build-
- name: Install bazelisk
run: |
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/$BAZEL"
chmod +x $BAZEL
sudo mv $BAZEL /usr/local/bin/bazel
- name: Build
run: bazel build //...
5 changes: 0 additions & 5 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ load("@bazel_gazelle//:def.bzl", "gazelle")
# gazelle:prefix github.com/openconfig/gnsi
gazelle(name = "gazelle")

alias(
name = "yang",
actual = "//yang:ocbinds",
)

alias(
name = "authz_go",
actual = "//authz:authz",
Expand Down
12 changes: 2 additions & 10 deletions acctz/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@ load("@rules_proto//proto:defs.bzl", "proto_library")
load("@rules_proto_grpc//cpp:defs.bzl", "cpp_grpc_library")
load("//:common.bzl", "use_new_compilers")

use_new_compilers()

package(default_visibility = ["//visibility:public"])

filegroup(
name = "yang",
srcs = glob(["*.yang"]),
)
use_new_compilers()

proto_library(
name = "acctz_proto",
Expand Down Expand Up @@ -40,10 +35,7 @@ cpp_grpc_library(
##############################################################################
go_proto_library(
name = "acctz_go_proto",
compilers = [
"go_protoc_gen_go",
"go_protoc_gen_go_grpc",
],
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
importpath = "github.com/openconfig/gnsi/acctz",
proto = ":acctz_proto",
deps = ["//version:version_go_proto"],
Expand Down
215 changes: 215 additions & 0 deletions acctz/acctz.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 3 additions & 11 deletions authz/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,15 @@ load("@rules_proto//proto:defs.bzl", "proto_library")
load("@rules_proto_grpc//cpp:defs.bzl", "cpp_grpc_library")
load("//:common.bzl", "use_new_compilers")

use_new_compilers()

package(default_visibility = ["//visibility:public"])

filegroup(
name = "yang",
srcs = glob(["*.yang"]),
)
use_new_compilers()

proto_library(
name = "authz_proto",
srcs = ["authz.proto"],
import_prefix = "github.com/openconfig/gnsi",
deps = ["//version:version_proto"],
import_prefix = "github.com/openconfig/gnsi",
)

##############################################################################
Expand All @@ -36,10 +31,7 @@ cpp_grpc_library(
##############################################################################
go_proto_library(
name = "authz_go_proto",
compilers = [
"go_protoc_gen_go",
"go_protoc_gen_go_grpc",
],
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
importpath = "github.com/openconfig/gnsi/authz",
proto = ":authz_proto",
deps = ["//version:version_go_proto"],
Expand Down
Loading

0 comments on commit 2f295bc

Please sign in to comment.