karafka-rdkafka 0.20.0.rc5-arm64-darwin → 0.21.0-arm64-darwin
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/{ci_linux_x86_64_musl.yml → ci_linux_alpine_x86_64_musl.yml} +63 -71
- data/.github/workflows/ci_linux_alpine_x86_64_musl_complementary.yml +264 -0
- data/.github/workflows/ci_linux_debian_x86_64_gnu.yml +271 -0
- data/.github/workflows/ci_linux_debian_x86_64_gnu_complementary.yml +334 -0
- data/.github/workflows/{ci_linux_x86_64_gnu.yml → ci_linux_ubuntu_aarch64_gnu.yml} +78 -56
- data/.github/workflows/ci_linux_ubuntu_aarch64_gnu_complementary.yml +295 -0
- data/.github/workflows/ci_linux_ubuntu_x86_64_gnu.yml +281 -0
- data/.github/workflows/ci_linux_ubuntu_x86_64_gnu_complementary.yml +294 -0
- data/.github/workflows/ci_macos_arm64.yml +28 -50
- data/.github/workflows/push_linux_aarch64_gnu.yml +65 -0
- data/.github/workflows/push_linux_x86_64_gnu.yml +4 -3
- data/.github/workflows/push_linux_x86_64_musl.yml +6 -4
- data/.github/workflows/push_macos_arm64.yml +3 -3
- data/.github/workflows/push_ruby.yml +1 -1
- data/.github/workflows/trigger-wiki-refresh.yml +30 -0
- data/.github/workflows/verify-action-pins.yml +1 -1
- data/.gitignore +1 -0
- data/.rspec +1 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +18 -2
- data/README.md +48 -147
- data/dist/cyrus-sasl-2.1.28.tar.gz +0 -0
- data/dist/krb5-1.21.3.tar.gz +0 -0
- data/dist/openssl-3.0.16.tar.gz +0 -0
- data/dist/zlib-1.3.1.tar.gz +0 -0
- data/dist/zstd-1.5.7.tar.gz +0 -0
- data/docker-compose-ssl.yml +35 -0
- data/ext/build_common.sh +18 -3
- data/ext/build_linux_aarch64_gnu.sh +326 -0
- data/ext/build_linux_x86_64_gnu.sh +17 -6
- data/ext/build_linux_x86_64_musl.sh +18 -8
- data/ext/build_macos_arm64.sh +7 -0
- data/ext/generate-ssl-certs.sh +109 -0
- data/ext/librdkafka.dylib +0 -0
- data/karafka-rdkafka.gemspec +3 -1
- data/lib/rdkafka/bindings.rb +6 -8
- data/lib/rdkafka/config.rb +1 -4
- data/lib/rdkafka/consumer.rb +1 -1
- data/lib/rdkafka/producer.rb +11 -6
- data/lib/rdkafka/version.rb +3 -3
- data/spec/integrations/ssl_stress_spec.rb +121 -0
- data/spec/{rdkafka → lib/rdkafka}/admin_spec.rb +219 -6
- data/spec/{rdkafka → lib/rdkafka}/bindings_spec.rb +0 -24
- data/spec/{rdkafka → lib/rdkafka}/config_spec.rb +1 -1
- data/spec/{rdkafka → lib/rdkafka}/consumer_spec.rb +50 -6
- data/spec/{rdkafka → lib/rdkafka}/metadata_spec.rb +2 -2
- data/spec/{rdkafka → lib/rdkafka}/producer/delivery_report_spec.rb +1 -1
- data/spec/{rdkafka → lib/rdkafka}/producer_spec.rb +301 -8
- data/spec/spec_helper.rb +65 -16
- metadata +87 -43
- data/spec/rdkafka/producer/partitions_count_spec.rb +0 -359
- /data/spec/{rdkafka → lib/rdkafka}/abstract_handle_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/admin/create_acl_handle_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/admin/create_acl_report_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/admin/create_topic_handle_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/admin/create_topic_report_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/admin/delete_acl_handle_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/admin/delete_acl_report_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/admin/delete_topic_handle_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/admin/delete_topic_report_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/admin/describe_acl_handle_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/admin/describe_acl_report_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/callbacks_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/consumer/headers_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/consumer/message_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/consumer/partition_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/consumer/topic_partition_list_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/error_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/native_kafka_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/producer/delivery_handle_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/producer/partitions_count_cache_spec.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: daf3fb477ad6b404d4c4a5f01b6496f33d31ceccfcc47f8307fd6ebd5c7451ed
|
4
|
+
data.tar.gz: 6735011385e395dbebdd6f41d6df9bd7d889f5c5f4db8d6d73b4d072880c8c9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1de6d06aee4f4c2006d0aa342e5da5624b8073d708022bbb7ce46bb24cb0dc8a32480865585e0e57ca4397928e782744a2be148ce41cb2a7933fd76e1979dd2
|
7
|
+
data.tar.gz: f8ffc91157f499d77c80e89664ec6a4fecb1b149affc0b321c0736ba67ea63a54860af0a14be175a1aeb0363db16984f2043fc701786acc5b4d451a7eebf609d
|
@@ -1,4 +1,27 @@
|
|
1
|
-
|
1
|
+
# Why We Build and Run Without Caching Native Extensions
|
2
|
+
#
|
3
|
+
# We intentionally compile the native librdkafka library fresh in each test job
|
4
|
+
# rather than caching or pre-building it for several reasons:
|
5
|
+
#
|
6
|
+
# 1. Architecture Compatibility
|
7
|
+
# - Pre-built native libraries (.so files) are architecture-specific
|
8
|
+
# - Can cause "Exec format error" when build/runtime environments differ
|
9
|
+
# - Building in the same container guarantees compatibility
|
10
|
+
#
|
11
|
+
# 2. Container Image Variations
|
12
|
+
# - Different Ruby Alpine images may have subtle differences in:
|
13
|
+
# * Base system libraries, compiler toolchains, musl libc versions
|
14
|
+
# - These differences can cause pre-built libraries to fail at runtime
|
15
|
+
#
|
16
|
+
# 3. Simplicity and Reliability
|
17
|
+
# - Single source of truth: everything builds and runs in same environment
|
18
|
+
# - No artifact management complexity or potential upload/download failures
|
19
|
+
# - Easier debugging when issues are contained in one job
|
20
|
+
#
|
21
|
+
# Trade-offs: Slightly longer CI times (~2-3 min per job) but much more reliable
|
22
|
+
# than dealing with architecture mismatches and artifact corruption issues.
|
23
|
+
|
24
|
+
name: CI Linux Alpine x86_64 musl
|
2
25
|
|
3
26
|
concurrency:
|
4
27
|
group: ${{ github.workflow }}-${{ github.ref }}
|
@@ -20,70 +43,39 @@ env:
|
|
20
43
|
BUNDLE_JOBS: 4
|
21
44
|
|
22
45
|
jobs:
|
23
|
-
build_install:
|
24
|
-
timeout-minutes: 30
|
25
|
-
runs-on: ubuntu-latest
|
26
|
-
container:
|
27
|
-
image: alpine:3.22@sha256:8a1f59ffb675680d47db6337b49d22281a139e9d709335b492be023728e11715
|
28
|
-
steps:
|
29
|
-
- name: Install dependencies
|
30
|
-
run: |
|
31
|
-
apk add --no-cache git curl ca-certificates build-base linux-headers \
|
32
|
-
pkgconf perl autoconf automake libtool bison flex file \
|
33
|
-
ruby ruby-dev ruby-bundler bash zstd-dev zlib zlib-dev openssl-dev cyrus-sasl-dev
|
34
|
-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
35
|
-
with:
|
36
|
-
fetch-depth: 0
|
37
|
-
- name: Configure git safe directory
|
38
|
-
run: git config --global --add safe.directory /__w/karafka-rdkafka/karafka-rdkafka
|
39
|
-
- name: Build gem with mini_portile
|
40
|
-
run: |
|
41
|
-
set -e
|
42
|
-
bundle config set --local path 'vendor/bundle'
|
43
|
-
bundle install
|
44
|
-
cd ext && bundle exec rake
|
45
|
-
cd ..
|
46
|
-
- name: Upload built gem and bundle
|
47
|
-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
48
|
-
with:
|
49
|
-
name: rdkafka-built-gem-musl
|
50
|
-
path: |
|
51
|
-
vendor/bundle/
|
52
|
-
.bundle/
|
53
|
-
ext/
|
54
|
-
lib/
|
55
|
-
retention-days: 1
|
56
|
-
|
57
46
|
specs_install:
|
58
|
-
timeout-minutes:
|
47
|
+
timeout-minutes: 45
|
59
48
|
runs-on: ubuntu-latest
|
60
|
-
needs: build_install
|
61
49
|
strategy:
|
62
50
|
fail-fast: false
|
63
51
|
matrix:
|
64
|
-
ruby:
|
65
|
-
- '3.4'
|
66
|
-
- '3.3'
|
67
|
-
- '3.2'
|
68
|
-
- '3.1'
|
69
52
|
include:
|
53
|
+
- ruby: '3.1'
|
54
|
+
alpine_version: '3.21'
|
55
|
+
- ruby: '3.2'
|
56
|
+
alpine_version: '3.21'
|
57
|
+
- ruby: '3.2'
|
58
|
+
alpine_version: '3.22'
|
59
|
+
- ruby: '3.3'
|
60
|
+
alpine_version: '3.21'
|
61
|
+
- ruby: '3.3'
|
62
|
+
alpine_version: '3.22'
|
63
|
+
- ruby: '3.4'
|
64
|
+
alpine_version: '3.21'
|
65
|
+
coverage: 'true'
|
70
66
|
- ruby: '3.4'
|
67
|
+
alpine_version: '3.22'
|
71
68
|
coverage: 'true'
|
72
69
|
steps:
|
73
70
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
74
71
|
with:
|
75
72
|
fetch-depth: 0
|
76
|
-
|
77
|
-
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
78
|
-
with:
|
79
|
-
name: rdkafka-built-gem-musl
|
80
|
-
path: ./
|
73
|
+
|
81
74
|
- name: Start Kafka with Docker Compose
|
82
75
|
run: |
|
83
|
-
docker compose up -d
|
76
|
+
docker compose -f docker-compose.yml up -d
|
84
77
|
echo "Waiting for Kafka to be ready..."
|
85
78
|
sleep 10
|
86
|
-
|
87
79
|
for i in {1..30}; do
|
88
80
|
if docker compose exec -T kafka kafka-topics --bootstrap-server localhost:9092 --list >/dev/null 2>&1; then
|
89
81
|
echo "Kafka topics command succeeded!"
|
@@ -91,39 +83,36 @@ jobs:
|
|
91
83
|
fi
|
92
84
|
sleep 2
|
93
85
|
done
|
94
|
-
|
86
|
+
|
87
|
+
- name: Run all specs in PLAINTEXT
|
95
88
|
env:
|
96
89
|
GITHUB_COVERAGE: ${{ matrix.coverage }}
|
97
|
-
RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
|
98
90
|
run: |
|
99
91
|
docker run --rm \
|
100
92
|
--network host \
|
101
93
|
-v "${{ github.workspace }}:/workspace" \
|
102
94
|
-w /workspace \
|
103
95
|
-e "GITHUB_COVERAGE=${{ matrix.coverage }}" \
|
104
|
-
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
cyrus-sasl-login \
|
109
|
-
cyrus-sasl-crammd5 \
|
110
|
-
|
111
|
-
cyrus-sasl-gssapiv2 \
|
112
|
-
cyrus-sasl-scram \
|
113
|
-
krb5-libs \
|
114
|
-
openssl \
|
115
|
-
zlib \
|
116
|
-
zlib-dev \
|
117
|
-
zstd-libs && \
|
96
|
+
ruby:${{ matrix.ruby }}-alpine${{ matrix.alpine_version }} \
|
97
|
+
sh -c 'apk add --no-cache git curl ca-certificates build-base linux-headers \
|
98
|
+
pkgconf perl autoconf automake libtool bison flex file \
|
99
|
+
ruby-dev ruby-bundler bash zstd-dev zlib zlib-dev openssl-dev \
|
100
|
+
cyrus-sasl-dev cyrus-sasl cyrus-sasl-login \
|
101
|
+
cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-gssapiv2 cyrus-sasl-scram \
|
102
|
+
krb5-libs openssl zlib zstd-libs && \
|
118
103
|
git config --global --add safe.directory /workspace && \
|
119
104
|
bundle config set --local path vendor/bundle && \
|
120
105
|
bundle install && \
|
106
|
+
cd ext && bundle exec rake && \
|
107
|
+
cd .. && \
|
121
108
|
bundle exec ruby -S rspec'
|
109
|
+
|
122
110
|
build_precompiled:
|
123
111
|
timeout-minutes: 45
|
124
112
|
runs-on: ubuntu-latest
|
125
113
|
container:
|
126
|
-
|
114
|
+
# Similar to GNU, we build on the oldest for ABI compatibility
|
115
|
+
image: alpine:3.18@sha256:de0eb0b3f2a47ba1eb89389859a9bd88b28e82f5826b6969ad604979713c2d4f # renovate: ignore
|
127
116
|
steps:
|
128
117
|
- name: Install dependencies
|
129
118
|
run: |
|
@@ -138,7 +127,7 @@ jobs:
|
|
138
127
|
- name: Configure git safe directory
|
139
128
|
run: git config --global --add safe.directory /__w/karafka-rdkafka/karafka-rdkafka
|
140
129
|
- name: Cache build-tmp directory
|
141
|
-
uses: actions/cache@
|
130
|
+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
|
142
131
|
with:
|
143
132
|
path: ext/build-tmp-musl
|
144
133
|
key: build-tmp-musl-${{ runner.os }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
|
@@ -173,13 +162,13 @@ jobs:
|
|
173
162
|
with:
|
174
163
|
fetch-depth: 0
|
175
164
|
- name: Download precompiled library
|
176
|
-
uses: actions/download-artifact@
|
165
|
+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
|
177
166
|
with:
|
178
167
|
name: librdkafka-precompiled-musl
|
179
168
|
path: ext/
|
180
169
|
- name: Start Kafka with Docker Compose
|
181
170
|
run: |
|
182
|
-
docker compose up -d
|
171
|
+
docker compose -f docker-compose.yml up -d
|
183
172
|
echo "Waiting for Kafka to be ready..."
|
184
173
|
sleep 10
|
185
174
|
|
@@ -190,7 +179,7 @@ jobs:
|
|
190
179
|
fi
|
191
180
|
sleep 2
|
192
181
|
done
|
193
|
-
- name: Run specs with precompiled library
|
182
|
+
- name: Run specs with precompiled library and PLAINTEXT
|
194
183
|
env:
|
195
184
|
GITHUB_COVERAGE: ${{ matrix.coverage }}
|
196
185
|
RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
|
@@ -202,4 +191,7 @@ jobs:
|
|
202
191
|
-e "GITHUB_COVERAGE=${{ matrix.coverage }}" \
|
203
192
|
-e "RDKAFKA_EXT_PATH=/workspace/ext" \
|
204
193
|
ruby:${{ matrix.ruby }}-alpine \
|
205
|
-
sh -c 'apk add --no-cache git build-base linux-headers bash &&
|
194
|
+
sh -c 'apk add --no-cache git build-base linux-headers bash && \
|
195
|
+
git config --global --add safe.directory /workspace && \
|
196
|
+
bundle config set --local path vendor/bundle && \
|
197
|
+
bundle install && bundle exec ruby -S rspec'
|
@@ -0,0 +1,264 @@
|
|
1
|
+
# CI Strategy: Complementary Testing for SSL and System Library Regressions on Alpine/musl
|
2
|
+
#
|
3
|
+
# This workflow runs complementary tests that don't need to block PRs but are essential
|
4
|
+
# for catching regressions in SSL functionality and musl libc/Alpine system library compatibility.
|
5
|
+
# It complements the main CI by testing stable-but-critical functionality on a nightly
|
6
|
+
# schedule and when workflow changes are made.
|
7
|
+
#
|
8
|
+
# WHY COMPLEMENTARY TESTING FOR ALPINE/MUSL:
|
9
|
+
# - SSL specs have been stable for 3+ years and rarely break due to code changes
|
10
|
+
# - Integration specs test musl libc and Alpine package compatibility
|
11
|
+
# - These tests catch regressions from external changes (OpenSSL updates, Alpine package updates)
|
12
|
+
# - Running every 3 days to prevent these slower tests from blocking PR velocity
|
13
|
+
# - Manual triggering allows testing workflow changes before they go into schedule
|
14
|
+
#
|
15
|
+
# SSL TESTING (specs_install + specs_precompiled):
|
16
|
+
# - Tests SSL/TLS connectivity with Kafka using docker-compose-ssl.yml on Alpine
|
17
|
+
# - Validates certificate handling and SSL handshakes across Ruby versions on musl
|
18
|
+
# - Ensures SSL works with both compiled-from-source and precompiled flows on Alpine
|
19
|
+
# - Catches OpenSSL version compatibility issues and SSL library regressions on musl
|
20
|
+
# - Tests real SSL scenarios that mirror Alpine-based production deployments
|
21
|
+
#
|
22
|
+
# INTEGRATION TESTING (integration specs in both jobs):
|
23
|
+
# - Tests musl libc and Alpine system library compatibility without requiring Kafka infrastructure
|
24
|
+
# - Validates libssl, libsasl2, libzstd, zlib integration across Alpine versions
|
25
|
+
# - Ensures native extensions work with different Alpine package versions
|
26
|
+
# - Catches regressions from Alpine package updates and musl libc changes
|
27
|
+
# - Tests both compilation and precompiled library compatibility on Alpine
|
28
|
+
#
|
29
|
+
# SCHEDULING STRATEGY:
|
30
|
+
# - Runs every 3 days at 5 AM to catch system/library changes from Alpine base image updates
|
31
|
+
# - Triggers on workflow file changes to validate CI modifications
|
32
|
+
# - Manual dispatch available for ad-hoc regression testing
|
33
|
+
# - Separate artifact naming prevents interference with main CI
|
34
|
+
#
|
35
|
+
# This approach ensures comprehensive coverage while keeping PR CI fast and focused
|
36
|
+
# on code-related issues rather than infrastructure/system regressions on Alpine.
|
37
|
+
|
38
|
+
name: CI Linux Complementary Alpine x86_64 musl
|
39
|
+
|
40
|
+
concurrency:
|
41
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
42
|
+
cancel-in-progress: true
|
43
|
+
|
44
|
+
on:
|
45
|
+
schedule:
|
46
|
+
- cron: '0 5 */3 * *'
|
47
|
+
workflow_dispatch:
|
48
|
+
push:
|
49
|
+
paths:
|
50
|
+
- '.github/workflows/ci_linux_alpine_x86_64_musl_complementary.yml'
|
51
|
+
branches: [ main, master ]
|
52
|
+
pull_request:
|
53
|
+
paths:
|
54
|
+
- '.github/workflows/ci_linux_alpine_x86_64_musl_complementary.yml'
|
55
|
+
branches: [ main, master ]
|
56
|
+
|
57
|
+
permissions:
|
58
|
+
contents: read
|
59
|
+
|
60
|
+
env:
|
61
|
+
BUNDLE_RETRY: 6
|
62
|
+
BUNDLE_JOBS: 4
|
63
|
+
|
64
|
+
jobs:
|
65
|
+
build_precompiled:
|
66
|
+
timeout-minutes: 45
|
67
|
+
runs-on: ubuntu-latest
|
68
|
+
container:
|
69
|
+
# Similar to GNU, we build on the oldest for ABI compatibility
|
70
|
+
image: alpine:3.18@sha256:de0eb0b3f2a47ba1eb89389859a9bd88b28e82f5826b6969ad604979713c2d4f # renovate: ignore
|
71
|
+
steps:
|
72
|
+
- name: Install dependencies
|
73
|
+
run: |
|
74
|
+
apk add --no-cache git curl ca-certificates build-base linux-headers \
|
75
|
+
pkgconf perl autoconf automake libtool bison flex file bash wget zstd-dev \
|
76
|
+
openssl-dev cyrus-sasl-dev cyrus-sasl cyrus-sasl-login \
|
77
|
+
cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-gssapiv2 cyrus-sasl-scram \
|
78
|
+
krb5-libs openssl zlib zlib-dev zstd-libs
|
79
|
+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
80
|
+
with:
|
81
|
+
fetch-depth: 0
|
82
|
+
- name: Configure git safe directory
|
83
|
+
run: git config --global --add safe.directory /__w/karafka-rdkafka/karafka-rdkafka
|
84
|
+
- name: Cache build-tmp directory
|
85
|
+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
|
86
|
+
with:
|
87
|
+
path: ext/build-tmp-musl
|
88
|
+
key: build-tmp-musl-${{ runner.os }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
|
89
|
+
- name: Build precompiled librdkafka.so
|
90
|
+
run: |
|
91
|
+
cd ext
|
92
|
+
bash ./build_linux_x86_64_musl.sh
|
93
|
+
- name: Upload precompiled library
|
94
|
+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
95
|
+
with:
|
96
|
+
name: librdkafka-precompiled-musl-complementary
|
97
|
+
path: ext/
|
98
|
+
retention-days: 1
|
99
|
+
|
100
|
+
specs_install:
|
101
|
+
timeout-minutes: 45
|
102
|
+
runs-on: ubuntu-latest
|
103
|
+
strategy:
|
104
|
+
fail-fast: false
|
105
|
+
matrix:
|
106
|
+
include:
|
107
|
+
- ruby: '3.4'
|
108
|
+
alpine_version: '3.22'
|
109
|
+
- ruby: '3.3'
|
110
|
+
alpine_version: '3.21'
|
111
|
+
- ruby: '3.2'
|
112
|
+
alpine_version: '3.21'
|
113
|
+
- ruby: '3.1'
|
114
|
+
alpine_version: '3.21'
|
115
|
+
steps:
|
116
|
+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
117
|
+
with:
|
118
|
+
fetch-depth: 0
|
119
|
+
|
120
|
+
- name: Start Kafka with Docker Compose
|
121
|
+
run: |
|
122
|
+
./ext/generate-ssl-certs.sh
|
123
|
+
docker compose -f docker-compose-ssl.yml up -d
|
124
|
+
echo "Waiting for Kafka to be ready..."
|
125
|
+
sleep 10
|
126
|
+
for i in {1..30}; do
|
127
|
+
if docker compose exec -T kafka kafka-topics --bootstrap-server localhost:9092 --list >/dev/null 2>&1; then
|
128
|
+
echo "Kafka topics command succeeded!"
|
129
|
+
break
|
130
|
+
fi
|
131
|
+
sleep 2
|
132
|
+
done
|
133
|
+
|
134
|
+
- name: Run all specs in SSL (compiled flow)
|
135
|
+
env:
|
136
|
+
KAFKA_SSL_ENABLED: "true"
|
137
|
+
run: |
|
138
|
+
docker run --rm \
|
139
|
+
--network host \
|
140
|
+
-v "${{ github.workspace }}:/workspace" \
|
141
|
+
-w /workspace \
|
142
|
+
-e "KAFKA_SSL_ENABLED=true" \
|
143
|
+
ruby:${{ matrix.ruby }}-alpine${{ matrix.alpine_version }} \
|
144
|
+
sh -c 'apk add --no-cache git curl ca-certificates build-base linux-headers \
|
145
|
+
pkgconf perl autoconf automake libtool bison flex file \
|
146
|
+
ruby-dev ruby-bundler bash zstd-dev zlib zlib-dev openssl-dev \
|
147
|
+
cyrus-sasl-dev cyrus-sasl cyrus-sasl-login \
|
148
|
+
cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-gssapiv2 cyrus-sasl-scram \
|
149
|
+
krb5-libs openssl zlib zstd-libs openjdk17-jre-headless && \
|
150
|
+
git config --global --add safe.directory /workspace && \
|
151
|
+
bundle config set --local path vendor/bundle && \
|
152
|
+
bundle install && \
|
153
|
+
cd ext && bundle exec rake && \
|
154
|
+
cd .. && \
|
155
|
+
echo "=== SSL Library Versions ===" && \
|
156
|
+
openssl version && \
|
157
|
+
apk list --installed | grep -E "(openssl|cyrus-sasl)" && \
|
158
|
+
echo "=== Running SSL Specs (Compiled) ===" && \
|
159
|
+
bundle exec ruby -S rspec'
|
160
|
+
|
161
|
+
- name: Run integration specs (compiled flow)
|
162
|
+
run: |
|
163
|
+
docker run --rm \
|
164
|
+
-v "${{ github.workspace }}:/workspace" \
|
165
|
+
-w /workspace \
|
166
|
+
ruby:${{ matrix.ruby }}-alpine${{ matrix.alpine_version }} \
|
167
|
+
sh -c 'apk add --no-cache git curl ca-certificates build-base linux-headers \
|
168
|
+
pkgconf perl autoconf automake libtool bison flex file \
|
169
|
+
ruby-dev ruby-bundler bash zstd-dev zlib zlib-dev openssl-dev \
|
170
|
+
cyrus-sasl-dev cyrus-sasl cyrus-sasl-login \
|
171
|
+
cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-gssapiv2 cyrus-sasl-scram \
|
172
|
+
krb5-libs openssl zlib zstd-libs libcurl curl-dev && \
|
173
|
+
git config --global --add safe.directory /workspace && \
|
174
|
+
bundle config set --local path vendor/bundle && \
|
175
|
+
bundle install && \
|
176
|
+
cd ext && bundle exec rake && \
|
177
|
+
cd .. && \
|
178
|
+
echo "=== Alpine/musl Library Versions ===" && \
|
179
|
+
openssl version && \
|
180
|
+
apk list --installed | grep -E "(openssl|cyrus-sasl|zstd|zlib)" && \
|
181
|
+
echo "=== Running Integration Specs (Compiled) ===" && \
|
182
|
+
for file in $(ls spec/integrations/*_spec.rb); do \
|
183
|
+
echo "Running $file with Ruby ${{ matrix.ruby }} on Alpine ${{ matrix.alpine_version }}"; \
|
184
|
+
bundle exec ruby "$file" || exit 1; \
|
185
|
+
done'
|
186
|
+
|
187
|
+
specs_precompiled:
|
188
|
+
timeout-minutes: 30
|
189
|
+
needs: build_precompiled
|
190
|
+
strategy:
|
191
|
+
fail-fast: false
|
192
|
+
matrix:
|
193
|
+
ruby:
|
194
|
+
- '3.4'
|
195
|
+
- '3.3'
|
196
|
+
- '3.2'
|
197
|
+
- '3.1'
|
198
|
+
runs-on: ubuntu-latest
|
199
|
+
steps:
|
200
|
+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
201
|
+
with:
|
202
|
+
fetch-depth: 0
|
203
|
+
- name: Download precompiled library
|
204
|
+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
|
205
|
+
with:
|
206
|
+
name: librdkafka-precompiled-musl-complementary
|
207
|
+
path: ext/
|
208
|
+
- name: Start Kafka with Docker Compose
|
209
|
+
run: |
|
210
|
+
./ext/generate-ssl-certs.sh
|
211
|
+
docker compose -f docker-compose-ssl.yml up -d
|
212
|
+
echo "Waiting for Kafka to be ready..."
|
213
|
+
sleep 10
|
214
|
+
|
215
|
+
for i in {1..30}; do
|
216
|
+
if docker compose exec -T kafka kafka-topics --bootstrap-server localhost:9092 --list >/dev/null 2>&1; then
|
217
|
+
echo "Kafka topics command succeeded!"
|
218
|
+
break
|
219
|
+
fi
|
220
|
+
sleep 2
|
221
|
+
done
|
222
|
+
|
223
|
+
- name: Run specs with precompiled library and SSL
|
224
|
+
env:
|
225
|
+
RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
|
226
|
+
KAFKA_SSL_ENABLED: "true"
|
227
|
+
run: |
|
228
|
+
docker run --rm \
|
229
|
+
--network host \
|
230
|
+
-v "${{ github.workspace }}:/workspace" \
|
231
|
+
-w /workspace \
|
232
|
+
-e "RDKAFKA_EXT_PATH=/workspace/ext" \
|
233
|
+
-e "KAFKA_SSL_ENABLED=true" \
|
234
|
+
ruby:${{ matrix.ruby }}-alpine \
|
235
|
+
sh -c 'apk add --no-cache git build-base linux-headers bash openjdk17-jre-headless && \
|
236
|
+
git config --global --add safe.directory /workspace && \
|
237
|
+
bundle config set --local path vendor/bundle && bundle install && \
|
238
|
+
apk list --installed | grep -E "(openssl|cyrus-sasl)" && \
|
239
|
+
bundle exec ruby -S rspec'
|
240
|
+
|
241
|
+
- name: Run integration specs (precompiled flow)
|
242
|
+
env:
|
243
|
+
RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
|
244
|
+
run: |
|
245
|
+
docker run --rm \
|
246
|
+
-v "${{ github.workspace }}:/workspace" \
|
247
|
+
-w /workspace \
|
248
|
+
-e "RDKAFKA_EXT_PATH=/workspace/ext" \
|
249
|
+
ruby:${{ matrix.ruby }}-alpine \
|
250
|
+
sh -c 'apk add --no-cache git curl ca-certificates build-base linux-headers \
|
251
|
+
pkgconf perl autoconf automake libtool bison flex file \
|
252
|
+
ruby-dev ruby-bundler bash zstd-dev zlib zlib-dev openssl-dev \
|
253
|
+
cyrus-sasl-dev cyrus-sasl cyrus-sasl-login \
|
254
|
+
cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-gssapiv2 cyrus-sasl-scram \
|
255
|
+
krb5-libs openssl zlib zstd-libs libcurl curl-dev && \
|
256
|
+
git config --global --add safe.directory /workspace && \
|
257
|
+
bundle config set --local path vendor/bundle && \
|
258
|
+
bundle install && \
|
259
|
+
apk list --installed | grep -E "(openssl|cyrus-sasl|zstd|zlib)" && \
|
260
|
+
echo "=== Running Integration Specs (Precompiled) ===" && \
|
261
|
+
for file in $(ls spec/integrations/*_spec.rb); do \
|
262
|
+
echo "Running $file with Ruby ${{ matrix.ruby }} (precompiled)"; \
|
263
|
+
bundle exec ruby "$file" || exit 1; \
|
264
|
+
done'
|