Skip to content

Commit 14bdc87

Browse files
authored
Merge pull request #422 from ruby-protobuf/gt/circle
Switch to circle-ci
2 parents 4f45a8a + 4e236eb commit 14bdc87

File tree

11 files changed

+426
-78
lines changed

11 files changed

+426
-78
lines changed

.circleci/config.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
version: 2.1
2+
3+
jobs:
4+
# skipping build step because Gemfile.lock is not included in the source
5+
# this makes the bundler caching step a noop
6+
test:
7+
parameters:
8+
ruby-image:
9+
type: string
10+
docker:
11+
- image: << parameters.ruby-image >>
12+
steps:
13+
- run:
14+
name: Install protobuf compiler
15+
command: |
16+
archive=protoc-3.16.0-linux-x86_64
17+
curl -O -L https://github.com/protocolbuffers/protobuf/releases/download/v3.16.0/$archive.zip
18+
sudo unzip -d '/usr/local' $archive.zip 'bin/*' 'include/*'
19+
sudo chown -R $(whoami) /usr/local/bin/protoc /usr/local/include/google
20+
rm -rf $archive.zip
21+
- run:
22+
command: protoc --version
23+
- run:
24+
command: sudo apt-get update
25+
- run:
26+
message: Install ZeroMQ
27+
command: sudo apt-get -y install libzmq3-dev
28+
- checkout
29+
- run:
30+
command: gem install bundler
31+
- run:
32+
command: bundle install
33+
- run:
34+
command: bundle exec rake
35+
36+
workflows:
37+
build_and_test:
38+
jobs:
39+
- test:
40+
matrix:
41+
parameters:
42+
ruby-image:
43+
- circleci/jruby:9.2.6.0-jdk
44+
- circleci/jruby:9.1.17.0-jdk
45+
- circleci/jruby:9.2-jdk8
46+
- circleci/ruby:2.4
47+
- circleci/ruby:2.5
48+
- circleci/ruby:2.7

.travis.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

Rakefile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ namespace :compile do
2222
task :spec do
2323
proto_path = ::File.expand_path('../spec/support/', __FILE__)
2424
proto_files = Dir[File.join(proto_path, '**', '*.proto')]
25-
cmd = %(protoc --plugin=./bin/protoc-gen-ruby --ruby_out=#{proto_path} -I #{proto_path} #{proto_files.join(' ')})
2625

27-
puts cmd
28-
system(cmd)
26+
proto_files.each do |proto_file|
27+
cmd = %(protoc --plugin=protoc-gen-ruby-protobuf=./bin/protoc-gen-ruby --ruby-protobuf_out=#{proto_path} -I #{proto_path} #{proto_file})
28+
puts cmd
29+
system(cmd) || fail("Failed to compile spec proto: #{proto_file}")
30+
end
2931
end
3032

3133
desc 'Compile rpc protos in protos/ directory'
@@ -35,10 +37,10 @@ namespace :compile do
3537
output_dir = ::File.expand_path('../tmp/rpc', __FILE__)
3638
::FileUtils.mkdir_p(output_dir)
3739

38-
cmd = %(protoc --plugin=./bin/protoc-gen-ruby --ruby_out=#{output_dir} -I #{proto_path} #{proto_files.join(' ')})
40+
cmd = %(protoc --plugin=protoc-gen-ruby-protobuf=./bin/protoc-gen-ruby --ruby-protobuf_out=#{output_dir} -I #{proto_path} #{proto_files.join(' ')})
3941

4042
puts cmd
41-
system(cmd)
43+
system(cmd) || fail("Failed to compile rpc protos!")
4244

4345
files = {
4446
'tmp/rpc/dynamic_discovery.pb.rb' => 'lib/protobuf/rpc',

install-protobuf.sh

Lines changed: 0 additions & 28 deletions
This file was deleted.

proto/dynamic_discovery.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
//
2323
// Protobufs needed for dynamic discovery zmq server and client.
2424

25+
syntax = "proto2";
26+
2527
package protobuf.rpc.dynamicDiscovery;
2628

2729
enum BeaconType {

proto/google/protobuf/compiler/plugin.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
// plugin should be named "protoc-gen-$NAME", and will then be used when the
4545
// flag "--${NAME}_out" is passed to protoc.
4646

47+
syntax = "proto2";
48+
4749
package google.protobuf.compiler;
4850
option java_package = "com.google.protobuf.compiler";
4951
option java_outer_classname = "PluginProtos";

proto/rpc.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
//
2323
// Protobufs needed for socket rpcs.
2424

25+
syntax = "proto2";
26+
2527
package protobuf.socketrpc;
2628

2729
message Request

0 commit comments

Comments
 (0)