Skip to content
Closed
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
122 changes: 0 additions & 122 deletions .circleci/config.yml

This file was deleted.

189 changes: 189 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
unit:
name: unit-ruby-${{ matrix.ruby-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-version: ["3.2"]
env:
LOG_LEVEL: DEBUG
steps:
- uses: actions/checkout@v4

- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true

- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y cmake # For installing snappy

- name: Run rspec
run: bundle exec rspec

functional-with-wurstmeister:
name: functional-wurstmeister-kafka-${{ matrix.kafka-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
kafka-version:
- "2.11-0.11.0.3"
- "2.11-1.0.2"
- "2.11-1.1.1"
- "2.11-2.0.1"
- "2.12-2.1.1"
- "2.12-2.2.1"
- "2.12-2.3.1"
- "2.12-2.4.0"
- "2.12-2.5.0"
- "2.13-2.6.0"
env:
LOG_LEVEL: DEBUG
services:
zookeeper:
image: wurstmeister/zookeeper
ports: ['2181:2181']
kafka1:
image: wurstmeister/kafka:${{ matrix.kafka-version }}
ports: ['9092:9092']
env:
KAFKA_BROKER_ID: 1
KAFKA_ADVERTISED_HOST_NAME: localhost
KAFKA_ADVERTISED_PORT: 9092
KAFKA_PORT: 9092 # Internal port Kafka listens on
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_DELETE_TOPIC_ENABLE: "true"
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
kafka2:
image: wurstmeister/kafka:${{ matrix.kafka-version }}
ports: ['9093:9093']
env:
KAFKA_BROKER_ID: 2
KAFKA_ADVERTISED_HOST_NAME: localhost
KAFKA_ADVERTISED_PORT: 9093
KAFKA_PORT: 9093
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_DELETE_TOPIC_ENABLE: "true"
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
kafka3:
image: wurstmeister/kafka:${{ matrix.kafka-version }}
ports: ['9094:9094']
env:
KAFKA_BROKER_ID: 3
KAFKA_ADVERTISED_HOST_NAME: localhost
KAFKA_ADVERTISED_PORT: 9094
KAFKA_PORT: 9094
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_DELETE_TOPIC_ENABLE: "true"
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
steps:
- uses: actions/checkout@v4

- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y cmake

- name: Set up Ruby 2.5
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.5"
bundler-cache: true

- name: Wait for Kafka services
run: |
echo "Waiting for Kafka services to be ready..."
sleep 30 # Adjust if needed; consider a more robust health check script

- name: Run functional tests (wurstmeister)
run: bundle exec rspec --profile --tag functional spec/functional

functional-with-bitnami:
name: functional-bitnami-kafka-${{ matrix.kafka-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
kafka-version: ["2.7.0"]
env:
LOG_LEVEL: DEBUG
services:
zookeeper:
image: bitnami/zookeeper:latest
ports: ['2181:2181']
env:
ALLOW_ANONYMOUS_LOGIN: "yes"
ZOO_ENABLE_AUTH: "no"
kafka1:
image: bitnami/kafka:${{ matrix.kafka-version }}
ports: ['9092:9092']
env:
KAFKA_CFG_BROKER_ID: 1
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092
KAFKA_CFG_LISTENERS: PLAINTEXT://0.0.0.0:9092
KAFKA_CFG_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_CFG_DELETE_TOPIC_ENABLE: "true"
ALLOW_PLAINTEXT_LISTENER: "yes"
KAFKA_CFG_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_CFG_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_CFG_TRANSACTION_STATE_LOG_MIN_ISR: 1
kafka2:
image: bitnami/kafka:${{ matrix.kafka-version }}
ports: ['9093:9093']
env:
KAFKA_CFG_BROKER_ID: 2
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9093
KAFKA_CFG_LISTENERS: PLAINTEXT://0.0.0.0:9093
KAFKA_CFG_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_CFG_DELETE_TOPIC_ENABLE: "true"
ALLOW_PLAINTEXT_LISTENER: "yes"
KAFKA_CFG_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_CFG_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_CFG_TRANSACTION_STATE_LOG_MIN_ISR: 1
kafka3:
image: bitnami/kafka:${{ matrix.kafka-version }}
ports: ['9094:9094']
env:
KAFKA_CFG_BROKER_ID: 3
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9094
KAFKA_CFG_LISTENERS: PLAINTEXT://0.0.0.0:9094
KAFKA_CFG_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_CFG_DELETE_TOPIC_ENABLE: "true"
ALLOW_PLAINTEXT_LISTENER: "yes"
KAFKA_CFG_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_CFG_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_CFG_TRANSACTION_STATE_LOG_MIN_ISR: 1
steps:
- uses: actions/checkout@v4

- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y cmake

- name: Set up Ruby 2.5
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.5"
bundler-cache: true

- name: Wait for Kafka services
run: |
echo "Waiting for Kafka services to be ready..."
sleep 45

- name: Run functional tests (bitnami)
run: bundle exec rspec --profile --tag functional spec/functional
2 changes: 1 addition & 1 deletion ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ If this is a bug report, please fill out the following:
* Version of Kafka:
* Version of ruby-kafka:

Please verify that the problem you're seeing hasn't been fixed by the current `master` of ruby-kafka.
Please verify that the problem you're seeing hasn't been fixed by the current `main` of ruby-kafka.

###### Steps to reproduce

Expand Down
1 change: 0 additions & 1 deletion ruby-kafka.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "prometheus-client", "~> 0.10.0"
spec.add_development_dependency "ruby-prof"
spec.add_development_dependency "timecop"
spec.add_development_dependency "rubocop", "~> 0.49.1"
spec.add_development_dependency "gssapi", ">= 1.2.0"
spec.add_development_dependency "stackprof"

Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
require "logger"
require "active_support"
# A missing require for try has been added to rails master here:
# https://github.com/rails/rails/commit/530f7805ed5790af1d472a041bc74089dc183f47
Expand All @@ -10,7 +11,6 @@
require "kafka"
require "kafka/tagged_logger"
require "dotenv"
require "logger"
require "rspec-benchmark"
require "colored"
require "securerandom"
Expand Down
Loading