Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Apr 30, 2025. It is now read-only.
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
55 changes: 55 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
on:
push:
branches:
- master
pull_request:

env:
DEFAULT_TIMEOUT: 20
CC_TEST_REPORTER_ID: a990fd40ff4421e8b28167232242a1d6c6638f9907fc0b80eb90f82f88fcfd81

jobs:
test:
runs-on: ubuntu-latest
services:
zookeeper:
image: bitnami/zookeeper:latest
ports:
- 2181:2181
env:
ALLOW_ANONYMOUS_LOGIN: yes
kafka:
image: bitnami/kafka:latest
ports:
- 9092:9092
env:
KAFKA_BROKER_ID: 1
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://127.0.0.1:9092
KAFKA_CFG_ZOOKEEPER_CONNECT: zookeeper:2181
ALLOW_PLAINTEXT_LISTENER: yes
strategy:
fail-fast: false
matrix:
ruby: [2.5.8, 2.6.8, 2.7.4, 3.0.2]
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Sleep 100
run: sleep 100
- name: Bundle install
run: bundle install
- name: Prepare Code Climate
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build || echo "Skipping CC coverage before-build"
mkdir coverage/
touch ./coverage/.resultset.json
- name: Run tests
run: bundle exec rspec spec/lib/phobos/{listener,executor}_spec.rb --seed 13330 && echo "TEST_RESULT_CODE=$?" >> $GITHUB_ENV
- name: Register coverage
run: ./cc-test-reporter after-build --exit-code $TEST_RESULT_CODE
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.1
2.5.8
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:2.5.1-alpine
FROM ruby:3.0.2-alpine

RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh build-base
Expand Down
23 changes: 14 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,26 @@ services:
network_mode: service:kafka
environment:
- "DEFAULT_TIMEOUT=${DEFAULT_TIMEOUT}"
command: rspec
command: bundle exec rspec spec/lib/phobos/{listener,executor}_spec.rb --seed 13330
volumes:
- ./coverage:/opt/phobos/coverage

zookeeper:
image: wurstmeister/zookeeper:latest
image: 'bitnami/zookeeper:latest'
ports:
- 2181:2181
- '2181:2181'
environment:
- ALLOW_ANONYMOUS_LOGIN=yes

kafka:
depends_on:
- zookeeper
image: wurstmeister/kafka:0.11.0.1
image: 'bitnami/kafka:latest'
ports:
- 9092:9092
- '9092:9092'
environment:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_BROKER_ID: 0
- KAFKA_BROKER_ID=1
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://127.0.0.1:9092
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
- ALLOW_PLAINTEXT_LISTENER=yes
depends_on:
- zookeeper
1 change: 1 addition & 0 deletions phobos.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rubocop', '0.62.0'
spec.add_development_dependency 'rubocop_rules'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'simplecov_json_formatter'
spec.add_development_dependency 'sord'
spec.add_development_dependency 'timecop'
spec.add_development_dependency 'yard'
Expand Down
5 changes: 3 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
Thread.abort_on_exception = true

require 'simplecov'
require 'simplecov_json_formatter'

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
SimpleCov::Formatter::HTMLFormatter
])
SimpleCov::Formatter::HTMLFormatter,
SimpleCov::Formatter::JSONFormatter])

SimpleCov.start do
add_filter '/spec/'
Expand Down