Skip to content

Commit

Permalink
[CI] Use rbenv to manage Ruby (#4893)
Browse files Browse the repository at this point in the history
And pin the Ruby version to 2.7.5. rbenv was installed on all CI
machines using Homebrew, with Ruby 2.7.5 installed and set as the
global version. The `pre-command` script was also updated on all agents
to add rbenv binaries to the path and run `rbenv init`.

Remove rules_ruby integration and just use rbenv and ruby directly.
  • Loading branch information
jpsim committed Apr 14, 2023
1 parent 8c617d7 commit 74b82da
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 41 deletions.
8 changes: 5 additions & 3 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ steps:
- swift test --parallel -Xswiftc -DDISABLE_FOCUSED_EXAMPLES
- label: "Danger"
commands:
- echo "--- Build Danger"
- bazel build //tools:danger
- echo "--- Install Bundler"
- gem install bundler
- echo "--- Bundle Install"
- bundle install
- echo "+++ Run Danger"
- ./bazel-bin/tools/danger --verbose
- bundle exec danger --verbose
- label: "TSan Tests"
commands:
- echo "+++ Test"
Expand Down
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module(
repo_name = "SwiftLint",
)

bazel_dep(name = "bazel_skylib", version = "1.4.1")
bazel_dep(name = "platforms", version = "0.0.6")
bazel_dep(name = "rules_apple", version = "2.2.0", repo_name = "build_bazel_rules_apple")
bazel_dep(name = "rules_swift", version = "1.7.1", repo_name = "build_bazel_rules_swift")
Expand Down
30 changes: 0 additions & 30 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,35 +1,5 @@
workspace(name = "SwiftLint")

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

git_repository(
name = "bazelruby_rules_ruby",
commit = "cc2f5ce961f7fa34557264dd05c7597e634f31e1",
remote = "https://github.com/bazelruby/rules_ruby.git",
shallow_since = "1679251731 -0700",
)

load(
"@bazelruby_rules_ruby//ruby:deps.bzl",
"rules_ruby_dependencies",
"rules_ruby_select_sdk",
)

rules_ruby_dependencies()

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",
)

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
Expand Down
8 changes: 0 additions & 8 deletions tools/BUILD
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
load("@bazelruby_rules_ruby//ruby:defs.bzl", "ruby_binary")

exports_files(["test-analyze.sh"])

ruby_binary(
name = "danger",
main = "@bundle//:bin/danger",
deps = ["@bundle//:bin"],
)

0 comments on commit 74b82da

Please sign in to comment.