[CI] Run Danger with Bazel (#4138)

It'd be nice to avoid needing to maintain rbenv on CI
This commit is contained in:
JP Simard 2022-08-28 22:58:39 -04:00 committed by GitHub
parent eb14f5283c
commit 0fd9a112b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 47 additions and 3 deletions

View File

@ -7,10 +7,10 @@ steps:
- bazel test --test_output=errors //Tests/...
- label: "Danger"
commands:
- echo "--- Bundle Install"
- bundle install
- echo "--- Build Danger"
- bazel build danger
- echo "+++ Run Danger"
- bundle exec danger --verbose
- bazel run danger --run_under="cd $PWD && " -- --verbose
- label: "Analyze"
commands:
- echo "+++ Analyze"

10
BUILD
View File

@ -131,3 +131,13 @@ sh_test(
":swiftlint",
],
)
# Danger
load("@bazelruby_rules_ruby//ruby:defs.bzl", "ruby_binary")
ruby_binary(
name = "danger",
main = "@bundle//:bin/danger",
deps = ["@bundle//:bin"],
)

View File

@ -48,3 +48,37 @@ http_archive(
load("@com_github_buildbuddy_io_rules_xcodeproj//xcodeproj:repositories.bzl", "xcodeproj_rules_dependencies")
xcodeproj_rules_dependencies()
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
git_repository(
name = "bazelruby_rules_ruby",
commit = "c93a6814b6193572c7c8b677b560314f52b31962",
remote = "https://github.com/bazelruby/rules_ruby.git",
shallow_since = "1651264604 -0700",
)
load(
"@bazelruby_rules_ruby//ruby:deps.bzl",
"rules_ruby_dependencies",
"rules_ruby_select_sdk",
)
rules_ruby_dependencies()
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()
rules_ruby_select_sdk(version = "host")
load(
"@bazelruby_rules_ruby//ruby:defs.bzl",
"ruby_bundle",
)
ruby_bundle(
name = "bundle",
gemfile = "//:Gemfile",
gemfile_lock = "//:Gemfile.lock",
)