karafka-rdkafka 0.21.0.rc1-arm64-darwin → 0.21.0.rc2-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} +12 -9
- 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} +15 -15
- 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 +5 -5
- data/.github/workflows/push_linux_aarch64_gnu.yml +65 -0
- data/.github/workflows/push_linux_x86_64_gnu.yml +2 -2
- data/.github/workflows/push_linux_x86_64_musl.yml +3 -3
- data/.github/workflows/push_macos_arm64.yml +2 -2
- 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/CHANGELOG.md +7 -1
- data/README.md +34 -134
- 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 +16 -1
- data/ext/build_linux_aarch64_gnu.sh +326 -0
- data/ext/build_linux_x86_64_gnu.sh +12 -1
- 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 +2 -0
- data/lib/rdkafka/bindings.rb +0 -1
- data/lib/rdkafka/consumer.rb +1 -1
- data/lib/rdkafka/version.rb +1 -1
- data/spec/integrations/ssl_stress_spec.rb +121 -0
- data/spec/{rdkafka → lib/rdkafka}/admin_spec.rb +16 -4
- data/spec/{rdkafka → lib/rdkafka}/consumer_spec.rb +50 -3
- 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 +6 -5
- data/spec/spec_helper.rb +45 -8
- metadata +76 -31
- /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}/bindings_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/callbacks_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/config_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
@@ -0,0 +1,295 @@
|
|
1
|
+
# CI Strategy: Complementary Testing for Ubuntu aarch64 Precompiled Binaries and Extended Compatibility
|
2
|
+
#
|
3
|
+
# This workflow runs complementary tests that don't need to block PRs but are essential
|
4
|
+
# for catching regressions in precompiled binary distribution, edge case Ruby versions,
|
5
|
+
# and system library compatibility on ARM64 architecture. It complements the main CI by
|
6
|
+
# testing scenarios that are stable-but-critical on a nightly schedule.
|
7
|
+
#
|
8
|
+
# WHY COMPLEMENTARY TESTING FOR AARCH64:
|
9
|
+
# - ARM64 precompiled binary testing is stable (rarely breaks from code changes)
|
10
|
+
# - Edge Ruby versions (3.1, 3.5-preview, JRuby) need testing but shouldn't block PRs
|
11
|
+
# - Integration specs test OS library compatibility, which changes with system updates
|
12
|
+
# - ARM64 architecture has specific compilation and linking considerations
|
13
|
+
# - These tests catch regressions from external changes (system libs, Ruby updates)
|
14
|
+
# - Running every 3 days to prevent these slower tests from blocking PR velocity
|
15
|
+
# - Manual triggering allows testing workflow changes before they go into schedule
|
16
|
+
#
|
17
|
+
# PRECOMPILED BINARY TESTING (build_precompiled + specs_precompiled):
|
18
|
+
# - Tests static library distribution works across Ubuntu versions on ARM64
|
19
|
+
# - Validates precompiled libraries don't have unexpected system dependencies
|
20
|
+
# - Ensures binary compatibility between different Ubuntu LTS versions on aarch64
|
21
|
+
# - Tests SSL/TLS connectivity with precompiled binaries on ARM64
|
22
|
+
# - Validates that removing build tools doesn't break precompiled usage
|
23
|
+
#
|
24
|
+
# EXTENDED COMPATIBILITY TESTING:
|
25
|
+
# - Edge case Ruby versions: 3.1, 3.5.0-preview1, JRuby-10.0 on ARM64
|
26
|
+
# - Integration specs testing system library compatibility
|
27
|
+
# - Both compilation and precompiled flows for comprehensive coverage
|
28
|
+
# - Cross-platform compatibility validation for aarch64 architecture
|
29
|
+
#
|
30
|
+
# SCHEDULING STRATEGY:
|
31
|
+
# - Runs every 3 days at 4 AM to catch system/library changes from base image updates
|
32
|
+
# - Triggers on workflow file changes to validate CI modifications
|
33
|
+
# - Manual dispatch available for ad-hoc regression testing
|
34
|
+
# - Separate artifact naming prevents interference with main CI
|
35
|
+
#
|
36
|
+
# This approach ensures comprehensive ARM64 coverage while keeping PR CI fast and focused
|
37
|
+
# on code-related issues rather than infrastructure/system regressions.
|
38
|
+
|
39
|
+
name: CI Linux Complementary Ubuntu aarch64 GNU
|
40
|
+
|
41
|
+
concurrency:
|
42
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
43
|
+
cancel-in-progress: true
|
44
|
+
|
45
|
+
on:
|
46
|
+
schedule:
|
47
|
+
- cron: '0 4 */3 * *'
|
48
|
+
workflow_dispatch:
|
49
|
+
push:
|
50
|
+
paths:
|
51
|
+
- '.github/workflows/ci_linux_ubuntu_aarch64_gnu_complementary.yml'
|
52
|
+
branches: [ main, master ]
|
53
|
+
pull_request:
|
54
|
+
paths:
|
55
|
+
- '.github/workflows/ci_linux_ubuntu_aarch64_gnu_complementary.yml'
|
56
|
+
branches: [ main, master ]
|
57
|
+
|
58
|
+
permissions:
|
59
|
+
contents: read
|
60
|
+
|
61
|
+
env:
|
62
|
+
BUNDLE_RETRY: 6
|
63
|
+
BUNDLE_JOBS: 4
|
64
|
+
|
65
|
+
jobs:
|
66
|
+
build_precompiled:
|
67
|
+
timeout-minutes: 30
|
68
|
+
# We precompile on older Ubuntu and check compatibility by running specs since we aim to
|
69
|
+
# release only one precompiled version for all supported Ubuntu versions
|
70
|
+
# This is why we do not want Renovate to update it automatically
|
71
|
+
runs-on: ubuntu-22.04-arm # renovate: ignore
|
72
|
+
steps:
|
73
|
+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
74
|
+
with:
|
75
|
+
fetch-depth: 0
|
76
|
+
- name: Install build dependencies
|
77
|
+
run: |
|
78
|
+
sudo apt-get update
|
79
|
+
sudo apt-get install -y --no-install-recommends \
|
80
|
+
build-essential \
|
81
|
+
gcc \
|
82
|
+
g++ \
|
83
|
+
make \
|
84
|
+
tar \
|
85
|
+
gzip \
|
86
|
+
wget \
|
87
|
+
curl \
|
88
|
+
file \
|
89
|
+
pkg-config \
|
90
|
+
autoconf \
|
91
|
+
automake \
|
92
|
+
libtool \
|
93
|
+
python3 \
|
94
|
+
git \
|
95
|
+
ca-certificates \
|
96
|
+
patch \
|
97
|
+
libsasl2-dev \
|
98
|
+
libssl-dev \
|
99
|
+
zlib1g-dev \
|
100
|
+
libzstd-dev \
|
101
|
+
bison \
|
102
|
+
flex \
|
103
|
+
perl \
|
104
|
+
binutils-dev
|
105
|
+
- name: Cache build-tmp directory
|
106
|
+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
|
107
|
+
with:
|
108
|
+
path: ext/build-tmp
|
109
|
+
key: build-tmp-${{ runner.os }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
|
110
|
+
- name: Build precompiled librdkafka.so
|
111
|
+
run: |
|
112
|
+
cd ext
|
113
|
+
./build_linux_aarch64_gnu.sh
|
114
|
+
- name: Upload precompiled library
|
115
|
+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
116
|
+
with:
|
117
|
+
name: librdkafka-precompiled-ubuntu-aarch64-complementary
|
118
|
+
path: ext/
|
119
|
+
retention-days: 1
|
120
|
+
|
121
|
+
specs_install:
|
122
|
+
timeout-minutes: 50
|
123
|
+
strategy:
|
124
|
+
fail-fast: false
|
125
|
+
matrix:
|
126
|
+
ruby:
|
127
|
+
- '3.5.0-preview1'
|
128
|
+
- '3.4'
|
129
|
+
- '3.3'
|
130
|
+
- '3.2'
|
131
|
+
- '3.1'
|
132
|
+
- 'jruby-10.0'
|
133
|
+
ubuntu-version: ['22.04', '24.04']
|
134
|
+
include:
|
135
|
+
- ruby: '3.4'
|
136
|
+
coverage: 'true'
|
137
|
+
- ruby: 'jruby-10.0'
|
138
|
+
continue-on-error: true
|
139
|
+
runs-on: ubuntu-${{ matrix.ubuntu-version }}-arm
|
140
|
+
steps:
|
141
|
+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
142
|
+
with:
|
143
|
+
fetch-depth: 0
|
144
|
+
- name: Set up Ruby
|
145
|
+
uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 # v1.254.0
|
146
|
+
with:
|
147
|
+
ruby-version: ${{matrix.ruby}}
|
148
|
+
bundler-cache: false
|
149
|
+
- name: Start Kafka with Docker Compose
|
150
|
+
run: |
|
151
|
+
./ext/generate-ssl-certs.sh
|
152
|
+
docker compose -f docker-compose-ssl.yml up -d
|
153
|
+
echo "Waiting for Kafka to be ready..."
|
154
|
+
|
155
|
+
sleep 10
|
156
|
+
|
157
|
+
echo "=== Container status ==="
|
158
|
+
docker compose ps kafka
|
159
|
+
|
160
|
+
for i in {1..30}; do
|
161
|
+
echo "=== Attempt $i/30 ==="
|
162
|
+
|
163
|
+
echo "Testing kafka-topics command..."
|
164
|
+
if docker compose exec -T kafka kafka-topics --bootstrap-server localhost:9092 --list >/dev/null 2>&1; then
|
165
|
+
echo "Kafka topics command succeeded!"
|
166
|
+
break
|
167
|
+
else
|
168
|
+
echo "Kafka topics command failed (exit code: $?)"
|
169
|
+
fi
|
170
|
+
|
171
|
+
echo "Sleeping 2 seconds..."
|
172
|
+
sleep 2
|
173
|
+
done
|
174
|
+
- name: Install dependencies
|
175
|
+
env:
|
176
|
+
RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
|
177
|
+
continue-on-error: ${{ matrix.continue-on-error || false }}
|
178
|
+
run: |
|
179
|
+
bundle install
|
180
|
+
- name: Build gem with mini_portile
|
181
|
+
continue-on-error: ${{ matrix.continue-on-error || false }}
|
182
|
+
run: |
|
183
|
+
set -e
|
184
|
+
cd ext && bundle exec rake
|
185
|
+
cd ..
|
186
|
+
- name: Run all specs in SSL (compiled flow)
|
187
|
+
env:
|
188
|
+
RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
|
189
|
+
KAFKA_SSL_ENABLED: "true"
|
190
|
+
continue-on-error: ${{ matrix.continue-on-error || false }}
|
191
|
+
run: |
|
192
|
+
bundle exec rspec
|
193
|
+
|
194
|
+
- name: Run integration specs (compiled flow)
|
195
|
+
continue-on-error: ${{ matrix.continue-on-error || false }}
|
196
|
+
run: |
|
197
|
+
for file in $(ls spec/integrations/*_spec.rb); do
|
198
|
+
echo "Running $file with Ruby ${{ matrix.ruby }}";
|
199
|
+
bundle exec ruby "$file" || exit 1;
|
200
|
+
done
|
201
|
+
|
202
|
+
specs_precompiled:
|
203
|
+
timeout-minutes: 30
|
204
|
+
needs: build_precompiled
|
205
|
+
strategy:
|
206
|
+
fail-fast: false
|
207
|
+
matrix:
|
208
|
+
ruby:
|
209
|
+
- '3.5.0-preview1'
|
210
|
+
- '3.4'
|
211
|
+
- '3.3'
|
212
|
+
- '3.2'
|
213
|
+
- '3.1'
|
214
|
+
ubuntu-version: ['22.04', '24.04']
|
215
|
+
|
216
|
+
runs-on: ubuntu-${{ matrix.ubuntu-version }}-arm
|
217
|
+
steps:
|
218
|
+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
219
|
+
with:
|
220
|
+
fetch-depth: 0
|
221
|
+
- name: Download precompiled library
|
222
|
+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
|
223
|
+
with:
|
224
|
+
name: librdkafka-precompiled-ubuntu-aarch64-complementary
|
225
|
+
path: ext/
|
226
|
+
- name: Set up Ruby
|
227
|
+
uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 # v1.254.0
|
228
|
+
with:
|
229
|
+
ruby-version: ${{ matrix.ruby }}
|
230
|
+
bundler-cache: false
|
231
|
+
- name: Start Kafka with Docker Compose
|
232
|
+
run: |
|
233
|
+
./ext/generate-ssl-certs.sh
|
234
|
+
docker compose -f docker-compose-ssl.yml up -d
|
235
|
+
echo "Waiting for Kafka to be ready..."
|
236
|
+
|
237
|
+
sleep 10
|
238
|
+
|
239
|
+
echo "=== Container status ==="
|
240
|
+
docker compose ps kafka
|
241
|
+
for i in {1..30}; do
|
242
|
+
echo "=== Attempt $i/30 ==="
|
243
|
+
|
244
|
+
echo "Testing kafka-topics command..."
|
245
|
+
if docker compose exec -T kafka kafka-topics --bootstrap-server localhost:9092 --list >/dev/null 2>&1; then
|
246
|
+
echo "Kafka topics command succeeded!"
|
247
|
+
break
|
248
|
+
else
|
249
|
+
echo "Kafka topics command failed (exit code: $?)"
|
250
|
+
fi
|
251
|
+
|
252
|
+
echo "Sleeping 2 seconds..."
|
253
|
+
sleep 2
|
254
|
+
done
|
255
|
+
- name: Install bundle with precompiled library
|
256
|
+
env:
|
257
|
+
RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
|
258
|
+
run: |
|
259
|
+
bundle install
|
260
|
+
echo "Bundle install completed with precompiled library"
|
261
|
+
- name: Remove build dependencies to test static linking
|
262
|
+
continue-on-error: true
|
263
|
+
run: |
|
264
|
+
echo "Removing build dependencies to verify precompiled library is truly self-contained..."
|
265
|
+
|
266
|
+
# Remove packages one by one to avoid dependency conflicts
|
267
|
+
packages_to_remove="build-essential gcc g++ make patch tar wget libsasl2-dev libssl-dev zlib1g-dev libzstd-dev"
|
268
|
+
|
269
|
+
for package in $packages_to_remove; do
|
270
|
+
if dpkg -l | grep -q "^ii.*$package "; then
|
271
|
+
echo "Removing $package..."
|
272
|
+
sudo dpkg --remove --force-depends $package 2>/dev/null || echo "Could not remove $package"
|
273
|
+
else
|
274
|
+
echo "$package is not installed"
|
275
|
+
fi
|
276
|
+
done
|
277
|
+
|
278
|
+
echo "Build dependencies removal completed"
|
279
|
+
echo "Remaining build tools:"
|
280
|
+
which gcc g++ make 2>/dev/null || echo "No build tools found in PATH (good!)"
|
281
|
+
- name: Run specs with precompiled library and SSL
|
282
|
+
env:
|
283
|
+
RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
|
284
|
+
KAFKA_SSL_ENABLED: "true"
|
285
|
+
run: |
|
286
|
+
bundle exec rspec
|
287
|
+
|
288
|
+
- name: Run integration specs (precompiled flow)
|
289
|
+
env:
|
290
|
+
RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
|
291
|
+
run: |
|
292
|
+
for file in $(ls spec/integrations/*_spec.rb); do
|
293
|
+
echo "Running $file with Ruby ${{ matrix.ruby }} (precompiled)";
|
294
|
+
bundle exec ruby "$file" || exit 1;
|
295
|
+
done
|
@@ -0,0 +1,281 @@
|
|
1
|
+
# CI Strategy: Comprehensive Testing of Build and Precompiled Flows
|
2
|
+
#
|
3
|
+
# This workflow tests both compilation-from-source and precompiled binary distribution
|
4
|
+
# strategies across multiple Ubuntu and Ruby versions to ensure broad compatibility and
|
5
|
+
# reliability.
|
6
|
+
#
|
7
|
+
# WHY WE TEST BOTH UBUNTU 22.04 AND 24.04:
|
8
|
+
# - Different system library versions (OpenSSL, zlib, libsasl2, libzstd, etc.)
|
9
|
+
# - Different GCC compiler versions that affect native extension compilation
|
10
|
+
# - Different glibc versions that can impact binary compatibility
|
11
|
+
# - Real-world deployment scenarios where users run on various Ubuntu LTS versions
|
12
|
+
# - Different Ruby versions
|
13
|
+
#
|
14
|
+
# COMPILATION FLOW (build_install + specs_install):
|
15
|
+
# - Tests that librdkafka compiles correctly from source on each Ubuntu version
|
16
|
+
# - Validates that mini_portile2 can successfully build native dependencies
|
17
|
+
# - Ensures Ruby native extensions link properly with system libraries
|
18
|
+
# - Verifies that the same codebase works across different toolchain versions
|
19
|
+
#
|
20
|
+
# PRECOMPILED FLOW (build_precompiled + specs_precompiled):
|
21
|
+
# - Tests our precompiled static libraries work on different Ubuntu versions
|
22
|
+
# - Validates that statically-linked binaries are truly portable across environments
|
23
|
+
# - Ensures precompiled libraries don't have unexpected system dependencies
|
24
|
+
# - Verifies that removing build tools doesn't break precompiled binary usage
|
25
|
+
#
|
26
|
+
# ARTIFACT ISOLATION:
|
27
|
+
# - Each Ubuntu version gets separate artifacts (rdkafka-built-gem-22.04, etc.)
|
28
|
+
# - Prevents cross-contamination of OS-specific compiled extensions
|
29
|
+
# - Ensures test accuracy by matching build and test environments
|
30
|
+
#
|
31
|
+
# This comprehensive approach catches issues that single-platform testing would miss,
|
32
|
+
# such as system library incompatibilities, compiler-specific bugs, or static linking
|
33
|
+
# problems that only manifest on specific Ubuntu versions.
|
34
|
+
|
35
|
+
name: CI Linux Ubuntu x86_64 GNU
|
36
|
+
|
37
|
+
concurrency:
|
38
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
39
|
+
cancel-in-progress: true
|
40
|
+
|
41
|
+
on:
|
42
|
+
pull_request:
|
43
|
+
branches: [ main, master ]
|
44
|
+
push:
|
45
|
+
branches: [ main, master ]
|
46
|
+
schedule:
|
47
|
+
- cron: '0 1 * * *'
|
48
|
+
|
49
|
+
permissions:
|
50
|
+
contents: read
|
51
|
+
|
52
|
+
env:
|
53
|
+
BUNDLE_RETRY: 6
|
54
|
+
BUNDLE_JOBS: 4
|
55
|
+
|
56
|
+
jobs:
|
57
|
+
specs_install:
|
58
|
+
timeout-minutes: 45
|
59
|
+
strategy:
|
60
|
+
fail-fast: false
|
61
|
+
matrix:
|
62
|
+
ruby:
|
63
|
+
- '3.5.0-preview1'
|
64
|
+
- '3.4'
|
65
|
+
- '3.3'
|
66
|
+
- '3.2'
|
67
|
+
- '3.1'
|
68
|
+
- 'jruby-10.0'
|
69
|
+
ubuntu-version: ['22.04', '24.04']
|
70
|
+
include:
|
71
|
+
- ruby: '3.4'
|
72
|
+
coverage: 'true'
|
73
|
+
- ruby: 'jruby-10.0'
|
74
|
+
continue-on-error: true
|
75
|
+
runs-on: ubuntu-${{ matrix.ubuntu-version }}
|
76
|
+
steps:
|
77
|
+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
78
|
+
with:
|
79
|
+
fetch-depth: 0
|
80
|
+
- name: Set up Ruby
|
81
|
+
uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 # v1.254.0
|
82
|
+
with:
|
83
|
+
ruby-version: ${{matrix.ruby}}
|
84
|
+
bundler-cache: false
|
85
|
+
- name: Start Kafka with Docker Compose
|
86
|
+
run: |
|
87
|
+
./ext/generate-ssl-certs.sh
|
88
|
+
docker compose -f docker-compose-ssl.yml up -d
|
89
|
+
echo "Waiting for Kafka to be ready..."
|
90
|
+
|
91
|
+
sleep 10
|
92
|
+
|
93
|
+
echo "=== Container status ==="
|
94
|
+
docker compose ps kafka
|
95
|
+
|
96
|
+
for i in {1..30}; do
|
97
|
+
echo "=== Attempt $i/30 ==="
|
98
|
+
|
99
|
+
echo "Testing kafka-topics command..."
|
100
|
+
if docker compose exec -T kafka kafka-topics --bootstrap-server localhost:9092 --list >/dev/null 2>&1; then
|
101
|
+
echo "Kafka topics command succeeded!"
|
102
|
+
break
|
103
|
+
else
|
104
|
+
echo "Kafka topics command failed (exit code: $?)"
|
105
|
+
fi
|
106
|
+
|
107
|
+
echo "Sleeping 2 seconds..."
|
108
|
+
sleep 2
|
109
|
+
done
|
110
|
+
- name: Install dependencies
|
111
|
+
env:
|
112
|
+
RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
|
113
|
+
run: |
|
114
|
+
# Only install gems that aren't Ruby-version specific
|
115
|
+
bundle install
|
116
|
+
- name: Build gem with mini_portile
|
117
|
+
run: |
|
118
|
+
set -e
|
119
|
+
cd ext && bundle exec rake
|
120
|
+
cd ..
|
121
|
+
- name: Run all specs in PLAINTEXT
|
122
|
+
env:
|
123
|
+
GITHUB_COVERAGE: ${{matrix.coverage}}
|
124
|
+
RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
|
125
|
+
continue-on-error: ${{ matrix.continue-on-error || false }}
|
126
|
+
run: |
|
127
|
+
bundle exec rspec
|
128
|
+
|
129
|
+
- name: Run all specs in SSL
|
130
|
+
env:
|
131
|
+
GITHUB_COVERAGE: ${{matrix.coverage}}
|
132
|
+
RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
|
133
|
+
KAFKA_SSL_ENABLED: "true"
|
134
|
+
continue-on-error: ${{ matrix.continue-on-error || false }}
|
135
|
+
run: |
|
136
|
+
bundle exec rspec
|
137
|
+
|
138
|
+
build_precompiled:
|
139
|
+
timeout-minutes: 30
|
140
|
+
# We precompile on older Ubuntu and check compatibility by running specs since we aim to
|
141
|
+
# release only one precompiled version for all supported Ubuntu versions
|
142
|
+
# This is why we do not want Renovate to update it automatically
|
143
|
+
runs-on: ubuntu-22.04 # renovate: ignore
|
144
|
+
steps:
|
145
|
+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
146
|
+
with:
|
147
|
+
fetch-depth: 0
|
148
|
+
- name: Install build dependencies
|
149
|
+
run: |
|
150
|
+
sudo apt-get update
|
151
|
+
sudo apt-get install -y --no-install-recommends \
|
152
|
+
build-essential \
|
153
|
+
gcc \
|
154
|
+
g++ \
|
155
|
+
make \
|
156
|
+
tar \
|
157
|
+
gzip \
|
158
|
+
wget \
|
159
|
+
curl \
|
160
|
+
file \
|
161
|
+
pkg-config \
|
162
|
+
autoconf \
|
163
|
+
automake \
|
164
|
+
libtool \
|
165
|
+
python3 \
|
166
|
+
git \
|
167
|
+
ca-certificates \
|
168
|
+
patch \
|
169
|
+
libsasl2-dev \
|
170
|
+
libssl-dev \
|
171
|
+
zlib1g-dev \
|
172
|
+
libzstd-dev \
|
173
|
+
bison \
|
174
|
+
flex \
|
175
|
+
perl \
|
176
|
+
binutils-dev
|
177
|
+
- name: Cache build-tmp directory
|
178
|
+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
|
179
|
+
with:
|
180
|
+
path: ext/build-tmp
|
181
|
+
key: build-tmp-${{ runner.os }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
|
182
|
+
- name: Build precompiled librdkafka.so
|
183
|
+
run: |
|
184
|
+
cd ext
|
185
|
+
./build_linux_x86_64_gnu.sh
|
186
|
+
- name: Upload precompiled library
|
187
|
+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
188
|
+
with:
|
189
|
+
name: librdkafka-precompiled-linux
|
190
|
+
path: ext/
|
191
|
+
retention-days: 1
|
192
|
+
|
193
|
+
specs_precompiled:
|
194
|
+
timeout-minutes: 30
|
195
|
+
needs: build_precompiled
|
196
|
+
strategy:
|
197
|
+
fail-fast: false
|
198
|
+
matrix:
|
199
|
+
ruby:
|
200
|
+
- '3.5.0-preview1'
|
201
|
+
- '3.4'
|
202
|
+
- '3.3'
|
203
|
+
- '3.2'
|
204
|
+
- '3.1'
|
205
|
+
ubuntu-version: ['22.04', '24.04']
|
206
|
+
include:
|
207
|
+
- ruby: '3.4'
|
208
|
+
ubuntu-version: '24.04'
|
209
|
+
coverage: 'true'
|
210
|
+
|
211
|
+
runs-on: ubuntu-${{ matrix.ubuntu-version }}
|
212
|
+
steps:
|
213
|
+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
214
|
+
with:
|
215
|
+
fetch-depth: 0
|
216
|
+
- name: Download precompiled library
|
217
|
+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
|
218
|
+
with:
|
219
|
+
name: librdkafka-precompiled-linux
|
220
|
+
path: ext/
|
221
|
+
- name: Set up Ruby
|
222
|
+
uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 # v1.254.0
|
223
|
+
with:
|
224
|
+
ruby-version: ${{ matrix.ruby }}
|
225
|
+
bundler-cache: false
|
226
|
+
- name: Start Kafka with Docker Compose
|
227
|
+
run: |
|
228
|
+
docker compose -f docker-compose.yml up -d
|
229
|
+
echo "Waiting for Kafka to be ready..."
|
230
|
+
|
231
|
+
sleep 10
|
232
|
+
|
233
|
+
echo "=== Container status ==="
|
234
|
+
docker compose ps kafka
|
235
|
+
for i in {1..30}; do
|
236
|
+
echo "=== Attempt $i/30 ==="
|
237
|
+
|
238
|
+
echo "Testing kafka-topics command..."
|
239
|
+
if docker compose exec -T kafka kafka-topics --bootstrap-server localhost:9092 --list >/dev/null 2>&1; then
|
240
|
+
echo "Kafka topics command succeeded!"
|
241
|
+
break
|
242
|
+
else
|
243
|
+
echo "Kafka topics command failed (exit code: $?)"
|
244
|
+
fi
|
245
|
+
|
246
|
+
echo "Sleeping 2 seconds..."
|
247
|
+
sleep 2
|
248
|
+
done
|
249
|
+
- name: Install bundle with precompiled library
|
250
|
+
env:
|
251
|
+
GITHUB_COVERAGE: ${{ matrix.coverage }}
|
252
|
+
RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
|
253
|
+
run: |
|
254
|
+
bundle install
|
255
|
+
echo "Bundle install completed with precompiled library"
|
256
|
+
- name: Remove build dependencies to test static linking
|
257
|
+
continue-on-error: true
|
258
|
+
run: |
|
259
|
+
echo "Removing build dependencies to verify precompiled library is truly self-contained..."
|
260
|
+
|
261
|
+
# Remove packages one by one to avoid dependency conflicts
|
262
|
+
packages_to_remove="build-essential gcc g++ make patch tar wget libsasl2-dev libssl-dev zlib1g-dev libzstd-dev"
|
263
|
+
|
264
|
+
for package in $packages_to_remove; do
|
265
|
+
if dpkg -l | grep -q "^ii.*$package "; then
|
266
|
+
echo "Removing $package..."
|
267
|
+
sudo dpkg --remove --force-depends $package 2>/dev/null || echo "Could not remove $package"
|
268
|
+
else
|
269
|
+
echo "$package is not installed"
|
270
|
+
fi
|
271
|
+
done
|
272
|
+
|
273
|
+
echo "Build dependencies removal completed"
|
274
|
+
echo "Remaining build tools:"
|
275
|
+
which gcc g++ make 2>/dev/null || echo "No build tools found in PATH (good!)"
|
276
|
+
- name: Run specs with precompiled library and PLAINTEXT
|
277
|
+
env:
|
278
|
+
GITHUB_COVERAGE: ${{ matrix.coverage }}
|
279
|
+
RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
|
280
|
+
run: |
|
281
|
+
bundle exec rspec
|