Skip to content

Commit

Permalink
Add MRI 3.0 to the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
p0deje committed Nov 13, 2022
1 parent c3cefa7 commit ed813aa
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 26 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
ruby:
- 2.7.6
- 3.0.4
os:
- ubuntu-latest
- macos-latest
Expand All @@ -21,7 +24,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- if: matrix.os == 'windows-latest'
run: echo "startup --output_user_root=D:/_bazel" >> .bazelrc
run: echo "startup --output_user_root=D:/" >> .bazelrc
- run: echo 'RUBY_VERSION = "${{ matrix.ruby }}"' > ruby_version.bzl
- run: bazel build ...
- run: bazel run lib/gem:print-version
- run: bazel run :rubocop
Expand Down
5 changes: 2 additions & 3 deletions examples/gem/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ local_repository(
)

load("@rules_ruby//ruby:deps.bzl", "rb_bundle", "rb_download")
load("ruby_version.bzl", "RUBY_VERSION")

rb_download(
version = "2.7.5"
)
rb_download(version = RUBY_VERSION)

rb_bundle(
name = "bundle",
Expand Down
5 changes: 4 additions & 1 deletion examples/gem/lib/gem/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ module GEM
VERSION = '0.1.0'
end

puts "Version is: #{GEM::VERSION}" if __FILE__ == $PROGRAM_NAME
if __FILE__ == $PROGRAM_NAME
puts "Ruby is: #{RUBY_ENGINE}/#{RUBY_VERSION}"
puts "Version is: #{GEM::VERSION}"
end
1 change: 1 addition & 0 deletions examples/gem/ruby_version.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
RUBY_VERSION = "2.7.6"
2 changes: 1 addition & 1 deletion ruby/private/bundle.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def _rb_bundle_impl(repository_ctx):
[bundle, "install"],
environment = {
"BUNDLE_BIN": repr(binstubs_path),
"BUNDLE_GEMFILE": repr(gemfile),
"BUNDLE_GEMFILE": gemfile.basename,
"BUNDLE_SHEBANG": repr(ruby),
},
working_directory = repr(gemfile.dirname),
Expand Down
12 changes: 2 additions & 10 deletions test.cmd
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
cd examples/gem

:: rb_library
bazel build :gem || exit /b

:: rb_binary
bazel build ... || exit /b
bazel run lib/gem:print-version || exit /b
bazel run :rubocop || exit /b

:: rb_test
bazel test spec:all || exit /b

:: rb_gem_build
bazel build :gem-build || exit /b
bazel test spec/... || exit /b
12 changes: 2 additions & 10 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@

cd examples/gem || exit 1

# rb_library
bazel build :gem || exit 1

# rb_binary
bazel build ... || exit 1
bazel run lib/gem:print-version || exit 1
bazel run :rubocop || exit 1

# rb_test
bazel test spec:all || exit 1

# rb_gem_build
bazel build :gem-build || exit 1
bazel test spec/... || exit 1

0 comments on commit ed813aa

Please sign in to comment.