@@ -17,17 +17,20 @@ jobs:
17
17
fail-fast : false
18
18
matrix :
19
19
include :
20
- - { name: Ruby 2.7, ruby: ruby-2.7.0, bazel: 5.1.1}
20
+ # Test both FFI and Native implementations on the highest and lowest
21
+ # Ruby versions for CRuby and JRuby, but only on Bazel 5.x.
22
+ - { name: Ruby 2.7, ruby: ruby-2.7.0, bazel: 5.1.1, ffi: NATIVE}
23
+ - { name: Ruby 2.7, ruby: ruby-2.7.0, bazel: 5.1.1, ffi: FFI}
21
24
- { name: Ruby 3.0, ruby: ruby-3.0.2, bazel: 5.1.1}
22
25
- { name: Ruby 3.1, ruby: ruby-3.1.0, bazel: 5.1.1}
23
- - { name: Ruby 3.2, ruby: ruby-3.2.0, bazel: 5.1.1}
24
- - { name: JRuby 9 .2, ruby: jruby-9 .2.20.1 , bazel: 5.1.1}
25
- - { name: JRuby 9.3 , ruby: jruby-9.3.10. 0, bazel: 5.1.1}
26
- - { name: JRuby 9.4, ruby: jruby-9.4.3.0, bazel: 5.1.1}
26
+ - { name: Ruby 3.2, ruby: ruby-3.2.0, bazel: 5.1.1, ffi: NATIVE }
27
+ - { name: Ruby 3 .2, ruby: ruby-3 .2.0 , bazel: 5.1.1, ffi: FFI }
28
+ - { name: JRuby 9.4 , ruby: jruby-9.4.3. 0, bazel: 5.1.1, ffi: NATIVE }
29
+ - { name: JRuby 9.4, ruby: jruby-9.4.3.0, bazel: 5.1.1, ffi: FFI }
27
30
- { name: Ruby 2.7 (Bazel6), ruby: ruby-2.7.0, bazel: 6.0.0}
28
31
- { name: JRuby 9.4 (Bazel6), ruby: jruby-9.4.3.0, bazel: 6.0.0}
29
32
30
- name : Linux ${{ matrix.name }}
33
+ name : Linux ${{ matrix.name }}${{ matrix.ffi == 'FFI' && ' FFI' || '' }}
31
34
runs-on : ubuntu-latest
32
35
steps :
33
36
- name : Checkout pending changes
40
43
image : ${{ matrix.image || format('us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:{0}-{1}-508417e5215994ade7585d28ba3aad681a25fa5d', matrix.ruby, matrix.bazel) }}
41
44
credentials : ${{ secrets.GAR_SERVICE_ACCOUNT }}
42
45
bazel-cache : ruby_linux/${{ matrix.ruby }}_${{ matrix.bazel }}
43
- bazel : test //ruby/... //ruby/tests:ruby_version --test_env=KOKORO_RUBY_VERSION
46
+ bazel : test //ruby/... //ruby/tests:ruby_version --test_env=KOKORO_RUBY_VERSION --test_env=BAZEL=true ${{ matrix.ffi == 'FFI' && '--//ruby:ffi=enabled --test_env=PROTOCOL_BUFFERS_RUBY_IMPLEMENTATION=FFI' || '' }}
44
47
45
48
linux-aarch64 :
46
49
name : Linux aarch64
@@ -78,10 +81,18 @@ jobs:
78
81
strategy :
79
82
fail-fast : false # Don't cancel all jobs if one fails.
80
83
matrix :
81
- # This is the full set of versions we support on MacOS.
82
- version : [ "2.7", "3.0", "3.1", "3.2" ]
84
+ include :
85
+ # Test both FFI and Native implementations on the highest and lowest
86
+ # Ruby versions for CRuby, but only on Bazel 5.x.
87
+ # Quote versions numbers otherwise 3.0 will render as 3
88
+ - { version: "2.7", ffi: NATIVE }
89
+ - { version: "2.7", ffi: FFI }
90
+ - { version: "3.0" }
91
+ - { version: "3.1" }
92
+ - { version: "3.2", ffi: NATIVE }
93
+ - { version: "3.2", ffi: FFI }
83
94
84
- name : MacOS Ruby ${{ matrix.version }}
95
+ name : MacOS Ruby ${{ matrix.version }}${{ matrix.ffi == 'FFI' && ' FFI' || '' }}
85
96
runs-on : macos-12
86
97
steps :
87
98
- name : Checkout pending changes
@@ -102,23 +113,26 @@ jobs:
102
113
with :
103
114
credentials : ${{ secrets.GAR_SERVICE_ACCOUNT }}
104
115
bazel-cache : ruby_macos/${{ matrix.version }}
105
- bazel : test //ruby/... --test_env=KOKORO_RUBY_VERSION=${{ matrix.version }}
116
+ bazel : test //ruby/... --test_env=KOKORO_RUBY_VERSION=${{ matrix.version }} --test_env=BAZEL=true ${{ matrix.ffi == 'FFI' && '--//ruby:ffi=enabled --test_env=PROTOCOL_BUFFERS_RUBY_IMPLEMENTATION=FFI' || '' }}
106
117
107
118
test_ruby_gems :
108
119
strategy :
109
120
fail-fast : false
110
121
matrix :
111
122
include :
112
- - { name: Ruby 2.7, ruby: ruby-2.7.0, bazel: 5.1.1}
123
+ # Test both FFI and Native implementations on the highest and lowest
124
+ # Ruby versions for CRuby and JRuby, but only on Bazel 5.x.
125
+ - { name: Ruby 2.7, ruby: ruby-2.7.0, bazel: 5.1.1, ffi: NATIVE }
126
+ - { name: Ruby 2.7, ruby: ruby-2.7.0, bazel: 5.1.1, ffi: FFI }
113
127
- { name: Ruby 3.0, ruby: ruby-3.0.2, bazel: 5.1.1}
114
128
- { name: Ruby 3.1, ruby: ruby-3.1.0, bazel: 5.1.1}
115
- - { name: Ruby 3.2, ruby: ruby-3.2.0, bazel: 5.1.1}
116
- - { name: JRuby 9 .2, ruby: jruby-9 .2.20.1 , bazel: 5.1.1}
117
- - { name: JRuby 9.3 , ruby: jruby-9.3.10. 0, bazel: 5.1.1}
118
- - { name: JRuby 9.4, ruby: jruby-9.4.3.0, bazel: 5.1.1}
129
+ - { name: Ruby 3.2, ruby: ruby-3.2.0, bazel: 5.1.1, ffi: NATIVE }
130
+ - { name: Ruby 3 .2, ruby: ruby-3 .2.0 , bazel: 5.1.1, ffi: FFI }
131
+ - { name: JRuby 9.4 , ruby: jruby-9.4.3. 0, bazel: 5.1.1, ffi: NATIVE }
132
+ - { name: JRuby 9.4, ruby: jruby-9.4.3.0, bazel: 5.1.1, ffi: FFI }
119
133
- { name: Ruby 2.7 (Bazel6), ruby: ruby-2.7.0, bazel: 6.0.0}
120
134
- { name: JRuby 9.4 (Bazel6), ruby: jruby-9.4.3.0, bazel: 6.0.0}
121
- name : Install ${{ matrix.name }}
135
+ name : Install ${{ matrix.name }}${{ matrix.ffi == 'FFI' && ' FFI' || '' }}
122
136
runs-on : ubuntu-latest
123
137
steps :
124
138
- name : Checkout pending changes
@@ -134,8 +148,9 @@ jobs:
134
148
bash : >
135
149
bazel --version;
136
150
ruby --version;
137
- bazel build //ruby:release //:protoc $BAZEL_FLAGS;
151
+ bazel build //ruby:release //:protoc ${{ matrix.ffi == 'FFI' && '--//ruby:ffi=enabled' || '' }} $ BAZEL_FLAGS;
138
152
gem install bazel-bin/ruby/google-protobuf-*;
139
153
bazel-bin/protoc --proto_path=src --proto_path=ruby/tests --proto_path=ruby --ruby_out=ruby tests/test_import_proto2.proto;
140
154
bazel-bin/protoc --proto_path=src --proto_path=ruby/tests --proto_path=ruby --ruby_out=ruby tests/basic_test.proto;
141
- ruby ruby/tests/basic.rb
155
+ ${{ matrix.ffi == 'FFI' && 'PROTOCOL_BUFFERS_RUBY_IMPLEMENTATION=FFI' || '' }} ruby ruby/tests/basic.rb;
156
+ ${{ matrix.ffi == 'FFI' && 'PROTOCOL_BUFFERS_RUBY_IMPLEMENTATION=FFI' || '' }} ruby ruby/tests/implementation.rb
0 commit comments