Skip to content

Commit

Permalink
bazel: Add @envoy_repo
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Northey <[email protected]>
  • Loading branch information
phlax committed Aug 15, 2024
1 parent 5780108 commit e2017d2
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 8 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/envoy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Envoy

permissions:
contents: read

on:
pull_request:
push:
branches:
- main

concurrency:
group: >-
${{ github.event.inputs.head_ref || github.run_id }}
jobs:
aptly:
runs-on: ubuntu-24.04
if: github.repository_owner == 'envoyproxy'
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- run: |
bazel build --config=ci @envoy_repo//:project | jq '.'
10 changes: 7 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ load("//:setup.bzl", "setup")
setup()

load("//:toolchains.bzl", "toolchains")
toolchains()
toolchains(VERSIONS)

load("//:setup_extra.bzl", "setup_extra")
setup_extra()

load("//:deps_extra.bzl", "dependencies_extra")
dependencies_extra()

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
# gazelle:repo bazel_gazelle
# gazelle:repository_macro deps-go.bzl%go_dependencies
gazelle_dependencies(go_repository_default_config = "//:WORKSPACE")
6 changes: 6 additions & 0 deletions deps_extra.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
load("@base_pip3//:requirements.bzl", pip_dependencies = "install_deps")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")

def dependencies_extra():
pip_dependencies()
gazelle_dependencies(go_repository_default_config = "//:WORKSPACE")
6 changes: 6 additions & 0 deletions setup_extra.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
load("@envoy//bazel:python_dependencies.bzl", "envoy_python_dependencies")
load("@envoy//bazel:repo.bzl", "envoy_repo")

def setup_extra():
envoy_python_dependencies()
envoy_repo()
11 changes: 6 additions & 5 deletions toolchains.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains")
load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains")
load("@rules_python//python:repositories.bzl", "python_register_toolchains")

def toolchains():
def _python_minor_version(python_version):
return "_".join(python_version.split(".")[:2])

def toolchains(versions):
python_register_toolchains(
name = "python3_12",
# Available versions are listed in @rules_python//python:versions.bzl.
# We recommend using the same version your team is already standardized on.
python_version = "3.12",
name = "python%s" % _python_minor_version(versions["python"]),
python_version = versions["python"],
)
rules_proto_toolchains()
go_register_toolchains(version = "1.22.4")

0 comments on commit e2017d2

Please sign in to comment.