Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup CircleCI to run bundle audit #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
version: 2
workflows:
version: 2
tests:
jobs:
- ruby-2.3-tests
- ruby-2.4-tests
- ruby-2.5-tests
audit:
jobs:
- audit
jobs:
ruby-2.3-tests: &test-template
docker:
- image: circleci/ruby:2.3-node-browsers
steps:
- checkout
- run:
name: Which bundler?
command: bundle -v
- run:
name: Bundle Install
command: bundle check || bundle install
- run:
name: Run rspec
command: |
bundle exec rspec --format RspecJunitFormatter \
--out test_results/rspec.xml \
--format progress
- store_test_results:
path: test_results
- run:
name: Run rubocop
command: bundle exec rubocop
ruby-2.4-tests:
<<: *test-template
docker:
- image: circleci/ruby:2.4-node-browsers
ruby-2.5-tests:
<<: *test-template
docker:
- image: circleci/ruby:2.5-node-browsers
audit:
docker:
- image: circleci/ruby:2.5-node-browsers
steps:
- checkout
- run:
name: Bundle Install
command: bundle check || bundle install
- run:
name: Run bundle audit
command: bundle audit check --update
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/doc/
/pkg/
/spec/reports/
/test_results/
/tmp/

# rspec failure tracking
Expand Down
2 changes: 2 additions & 0 deletions bunnyrun.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ Gem::Specification.new do |spec|
spec.require_paths = ['lib']

spec.add_development_dependency 'bundler', '~> 1.14'
spec.add_development_dependency 'bundler-audit'
spec.add_development_dependency 'byebug'
spec.add_development_dependency 'guard-rspec'
spec.add_development_dependency 'guard-rubocop'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'rspec_junit_formatter'
spec.add_development_dependency 'rubocop', '~> 0.51'
spec.add_development_dependency 'rubocop-rspec', '~> 1.24'

Expand Down
1 change: 1 addition & 0 deletions examples/application-example/lib/foobar/ping_consumer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def perform(message)
message.ack

return unless options.success_message

logger.info("#{self.class}: #{options.success_message}")
end
end
Expand Down
1 change: 1 addition & 0 deletions examples/application-example/lib/foobar/pong_consumer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def perform(message)
message.ack

return unless options.success_message

logger.info("#{self.class}: #{options.success_message}")
end
end
Expand Down
3 changes: 3 additions & 0 deletions lib/bunnyrun/consumer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def children

def queue(name = nil, attrs = {})
return @queue if name.nil?

@queue = { name: name, attrs: attrs }
end

Expand All @@ -34,11 +35,13 @@ def bind(exchange_name, attrs = {})

def manual_ack(value = nil)
return @manual_ack || false if value.nil?

@manual_ack = value
end

def prefetch(count = nil)
return @prefetch if count.nil?

@prefetch = count
end

Expand Down
1 change: 1 addition & 0 deletions lib/bunnyrun/message.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def channel

def acked?
return unless manual_ack?

@acked
end

Expand Down