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.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/{ci_linux_x86_64_musl.yml → ci_linux_alpine_x86_64_musl.yml} +63 -71
  3. data/.github/workflows/ci_linux_alpine_x86_64_musl_complementary.yml +264 -0
  4. data/.github/workflows/ci_linux_debian_x86_64_gnu.yml +271 -0
  5. data/.github/workflows/ci_linux_debian_x86_64_gnu_complementary.yml +334 -0
  6. data/.github/workflows/{ci_linux_x86_64_gnu.yml → ci_linux_ubuntu_aarch64_gnu.yml} +78 -56
  7. data/.github/workflows/ci_linux_ubuntu_aarch64_gnu_complementary.yml +295 -0
  8. data/.github/workflows/ci_linux_ubuntu_x86_64_gnu.yml +281 -0
  9. data/.github/workflows/ci_linux_ubuntu_x86_64_gnu_complementary.yml +294 -0
  10. data/.github/workflows/ci_macos_arm64.yml +28 -50
  11. data/.github/workflows/push_linux_aarch64_gnu.yml +65 -0
  12. data/.github/workflows/push_linux_x86_64_gnu.yml +4 -3
  13. data/.github/workflows/push_linux_x86_64_musl.yml +6 -4
  14. data/.github/workflows/push_macos_arm64.yml +3 -3
  15. data/.github/workflows/push_ruby.yml +1 -1
  16. data/.github/workflows/trigger-wiki-refresh.yml +30 -0
  17. data/.github/workflows/verify-action-pins.yml +1 -1
  18. data/.gitignore +1 -0
  19. data/.rspec +1 -0
  20. data/.ruby-version +1 -1
  21. data/CHANGELOG.md +18 -2
  22. data/README.md +48 -147
  23. data/dist/cyrus-sasl-2.1.28.tar.gz +0 -0
  24. data/dist/krb5-1.21.3.tar.gz +0 -0
  25. data/dist/openssl-3.0.16.tar.gz +0 -0
  26. data/dist/zlib-1.3.1.tar.gz +0 -0
  27. data/dist/zstd-1.5.7.tar.gz +0 -0
  28. data/docker-compose-ssl.yml +35 -0
  29. data/ext/build_common.sh +18 -3
  30. data/ext/build_linux_aarch64_gnu.sh +326 -0
  31. data/ext/build_linux_x86_64_gnu.sh +17 -6
  32. data/ext/build_linux_x86_64_musl.sh +18 -8
  33. data/ext/build_macos_arm64.sh +7 -0
  34. data/ext/generate-ssl-certs.sh +109 -0
  35. data/ext/librdkafka.dylib +0 -0
  36. data/karafka-rdkafka.gemspec +3 -1
  37. data/lib/rdkafka/bindings.rb +6 -8
  38. data/lib/rdkafka/config.rb +1 -4
  39. data/lib/rdkafka/consumer.rb +1 -1
  40. data/lib/rdkafka/producer.rb +11 -6
  41. data/lib/rdkafka/version.rb +3 -3
  42. data/spec/integrations/ssl_stress_spec.rb +121 -0
  43. data/spec/{rdkafka → lib/rdkafka}/admin_spec.rb +219 -6
  44. data/spec/{rdkafka → lib/rdkafka}/bindings_spec.rb +0 -24
  45. data/spec/{rdkafka → lib/rdkafka}/config_spec.rb +1 -1
  46. data/spec/{rdkafka → lib/rdkafka}/consumer_spec.rb +50 -6
  47. data/spec/{rdkafka → lib/rdkafka}/metadata_spec.rb +2 -2
  48. data/spec/{rdkafka → lib/rdkafka}/producer/delivery_report_spec.rb +1 -1
  49. data/spec/{rdkafka → lib/rdkafka}/producer_spec.rb +301 -8
  50. data/spec/spec_helper.rb +65 -16
  51. metadata +87 -43
  52. data/spec/rdkafka/producer/partitions_count_spec.rb +0 -359
  53. /data/spec/{rdkafka → lib/rdkafka}/abstract_handle_spec.rb +0 -0
  54. /data/spec/{rdkafka → lib/rdkafka}/admin/create_acl_handle_spec.rb +0 -0
  55. /data/spec/{rdkafka → lib/rdkafka}/admin/create_acl_report_spec.rb +0 -0
  56. /data/spec/{rdkafka → lib/rdkafka}/admin/create_topic_handle_spec.rb +0 -0
  57. /data/spec/{rdkafka → lib/rdkafka}/admin/create_topic_report_spec.rb +0 -0
  58. /data/spec/{rdkafka → lib/rdkafka}/admin/delete_acl_handle_spec.rb +0 -0
  59. /data/spec/{rdkafka → lib/rdkafka}/admin/delete_acl_report_spec.rb +0 -0
  60. /data/spec/{rdkafka → lib/rdkafka}/admin/delete_topic_handle_spec.rb +0 -0
  61. /data/spec/{rdkafka → lib/rdkafka}/admin/delete_topic_report_spec.rb +0 -0
  62. /data/spec/{rdkafka → lib/rdkafka}/admin/describe_acl_handle_spec.rb +0 -0
  63. /data/spec/{rdkafka → lib/rdkafka}/admin/describe_acl_report_spec.rb +0 -0
  64. /data/spec/{rdkafka → lib/rdkafka}/callbacks_spec.rb +0 -0
  65. /data/spec/{rdkafka → lib/rdkafka}/consumer/headers_spec.rb +0 -0
  66. /data/spec/{rdkafka → lib/rdkafka}/consumer/message_spec.rb +0 -0
  67. /data/spec/{rdkafka → lib/rdkafka}/consumer/partition_spec.rb +0 -0
  68. /data/spec/{rdkafka → lib/rdkafka}/consumer/topic_partition_list_spec.rb +0 -0
  69. /data/spec/{rdkafka → lib/rdkafka}/error_spec.rb +0 -0
  70. /data/spec/{rdkafka → lib/rdkafka}/native_kafka_spec.rb +0 -0
  71. /data/spec/{rdkafka → lib/rdkafka}/producer/delivery_handle_spec.rb +0 -0
  72. /data/spec/{rdkafka → lib/rdkafka}/producer/partitions_count_cache_spec.rb +0 -0
@@ -1,4 +1,38 @@
1
- name: CI Linux x86_64 GNU
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 aarch64 GNU
2
36
 
3
37
  concurrency:
4
38
  group: ${{ github.workflow }}-${{ github.ref }}
@@ -10,7 +44,7 @@ on:
10
44
  push:
11
45
  branches: [ main, master ]
12
46
  schedule:
13
- - cron: '0 1 * * *'
47
+ - cron: '0 4 * * *'
14
48
 
15
49
  permissions:
16
50
  contents: read
@@ -20,41 +54,8 @@ env:
20
54
  BUNDLE_JOBS: 4
21
55
 
22
56
  jobs:
23
- build_install:
24
- timeout-minutes: 30
25
- runs-on: ubuntu-latest
26
- steps:
27
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28
- with:
29
- fetch-depth: 0
30
- - name: Install package dependencies
31
- run: "[ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends $APT_DEPS"
32
- - name: Set up Ruby
33
- uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
34
- with:
35
- ruby-version: '3.4' # Use one Ruby version for building
36
- bundler-cache: false
37
- - name: Build gem with mini_portile
38
- run: |
39
- set -e
40
- bundle install
41
- cd ext && bundle exec rake
42
- cd ..
43
- - name: Upload built gem and bundle
44
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
45
- with:
46
- name: rdkafka-built-gem
47
- path: |
48
- vendor/bundle/
49
- .bundle/
50
- ext/
51
- lib/
52
- retention-days: 1
53
-
54
57
  specs_install:
55
- timeout-minutes: 30
56
- runs-on: ubuntu-latest
57
- needs: build_install
58
+ timeout-minutes: 45
58
59
  strategy:
59
60
  fail-fast: false
60
61
  matrix:
@@ -65,28 +66,25 @@ jobs:
65
66
  - '3.2'
66
67
  - '3.1'
67
68
  - 'jruby-10.0'
69
+ ubuntu-version: ['22.04', '24.04']
68
70
  include:
69
71
  - ruby: '3.4'
70
72
  coverage: 'true'
71
73
  - ruby: 'jruby-10.0'
72
74
  continue-on-error: true
75
+ runs-on: ubuntu-${{ matrix.ubuntu-version }}-arm
73
76
  steps:
74
77
  - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
75
78
  with:
76
79
  fetch-depth: 0
77
- - name: Download built gem
78
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
79
- with:
80
- name: rdkafka-built-gem
81
- path: ./
82
80
  - name: Set up Ruby
83
- uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
81
+ uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 # v1.254.0
84
82
  with:
85
83
  ruby-version: ${{matrix.ruby}}
86
84
  bundler-cache: false
87
85
  - name: Start Kafka with Docker Compose
88
86
  run: |
89
- docker compose up -d
87
+ docker compose -f docker-compose.yml up -d
90
88
  echo "Waiting for Kafka to be ready..."
91
89
 
92
90
  sleep 10
@@ -108,13 +106,18 @@ jobs:
108
106
  echo "Sleeping 2 seconds..."
109
107
  sleep 2
110
108
  done
111
- - name: Install remaining dependencies
109
+ - name: Install dependencies
112
110
  env:
113
111
  RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
114
112
  run: |
115
113
  # Only install gems that aren't Ruby-version specific
116
114
  bundle install
117
- - name: Run all specs
115
+ - name: Build gem with mini_portile
116
+ run: |
117
+ set -e
118
+ cd ext && bundle exec rake
119
+ cd ..
120
+ - name: Run all specs in PLAINTEXT
118
121
  env:
119
122
  GITHUB_COVERAGE: ${{matrix.coverage}}
120
123
  RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
@@ -124,7 +127,10 @@ jobs:
124
127
 
125
128
  build_precompiled:
126
129
  timeout-minutes: 30
127
- runs-on: ubuntu-latest
130
+ # We precompile on older Ubuntu and check compatibility by running specs since we aim to
131
+ # release only one precompiled version for all supported Ubuntu versions
132
+ # This is why we do not want Renovate to update it automatically
133
+ runs-on: ubuntu-22.04-arm # renovate: ignore
128
134
  steps:
129
135
  - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
130
136
  with:
@@ -135,24 +141,38 @@ jobs:
135
141
  sudo apt-get install -y --no-install-recommends \
136
142
  build-essential \
137
143
  gcc \
144
+ g++ \
138
145
  make \
139
- patch \
140
146
  tar \
147
+ gzip \
141
148
  wget \
149
+ curl \
150
+ file \
151
+ pkg-config \
152
+ autoconf \
153
+ automake \
154
+ libtool \
155
+ python3 \
156
+ git \
142
157
  ca-certificates \
158
+ patch \
143
159
  libsasl2-dev \
144
160
  libssl-dev \
145
161
  zlib1g-dev \
146
- libzstd-dev
162
+ libzstd-dev \
163
+ bison \
164
+ flex \
165
+ perl \
166
+ binutils-dev
147
167
  - name: Cache build-tmp directory
148
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
168
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
149
169
  with:
150
170
  path: ext/build-tmp
151
171
  key: build-tmp-${{ runner.os }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
152
172
  - name: Build precompiled librdkafka.so
153
173
  run: |
154
174
  cd ext
155
- ./build_linux_x86_64_gnu.sh
175
+ ./build_linux_aarch64_gnu.sh
156
176
  - name: Upload precompiled library
157
177
  uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
158
178
  with:
@@ -162,7 +182,6 @@ jobs:
162
182
 
163
183
  specs_precompiled:
164
184
  timeout-minutes: 30
165
- runs-on: ubuntu-latest
166
185
  needs: build_precompiled
167
186
  strategy:
168
187
  fail-fast: false
@@ -173,33 +192,36 @@ jobs:
173
192
  - '3.3'
174
193
  - '3.2'
175
194
  - '3.1'
195
+ ubuntu-version: ['22.04', '24.04']
176
196
  include:
177
197
  - ruby: '3.4'
198
+ ubuntu-version: '24.04'
178
199
  coverage: 'true'
200
+
201
+ runs-on: ubuntu-${{ matrix.ubuntu-version }}-arm
179
202
  steps:
180
203
  - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
181
204
  with:
182
205
  fetch-depth: 0
183
206
  - name: Download precompiled library
184
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
207
+ uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
185
208
  with:
186
209
  name: librdkafka-precompiled-linux
187
210
  path: ext/
188
211
  - name: Set up Ruby
189
- uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
212
+ uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 # v1.254.0
190
213
  with:
191
214
  ruby-version: ${{ matrix.ruby }}
192
215
  bundler-cache: false
193
216
  - name: Start Kafka with Docker Compose
194
217
  run: |
195
- docker compose up -d
218
+ docker compose -f docker-compose.yml up -d
196
219
  echo "Waiting for Kafka to be ready..."
197
220
 
198
221
  sleep 10
199
222
 
200
223
  echo "=== Container status ==="
201
224
  docker compose ps kafka
202
-
203
225
  for i in {1..30}; do
204
226
  echo "=== Attempt $i/30 ==="
205
227
 
@@ -241,7 +263,7 @@ jobs:
241
263
  echo "Build dependencies removal completed"
242
264
  echo "Remaining build tools:"
243
265
  which gcc g++ make 2>/dev/null || echo "No build tools found in PATH (good!)"
244
- - name: Run specs with precompiled library
266
+ - name: Run specs with precompiled library and PLAINTEXT
245
267
  env:
246
268
  GITHUB_COVERAGE: ${{ matrix.coverage }}
247
269
  RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
@@ -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