karafka-rdkafka 0.21.0-aarch64-linux-gnu

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 (119) hide show
  1. checksums.yaml +7 -0
  2. data/.github/CODEOWNERS +3 -0
  3. data/.github/FUNDING.yml +1 -0
  4. data/.github/workflows/ci_linux_alpine_x86_64_musl.yml +197 -0
  5. data/.github/workflows/ci_linux_alpine_x86_64_musl_complementary.yml +264 -0
  6. data/.github/workflows/ci_linux_debian_x86_64_gnu.yml +271 -0
  7. data/.github/workflows/ci_linux_debian_x86_64_gnu_complementary.yml +334 -0
  8. data/.github/workflows/ci_linux_ubuntu_aarch64_gnu.yml +271 -0
  9. data/.github/workflows/ci_linux_ubuntu_aarch64_gnu_complementary.yml +295 -0
  10. data/.github/workflows/ci_linux_ubuntu_x86_64_gnu.yml +281 -0
  11. data/.github/workflows/ci_linux_ubuntu_x86_64_gnu_complementary.yml +294 -0
  12. data/.github/workflows/ci_macos_arm64.yml +284 -0
  13. data/.github/workflows/push_linux_aarch64_gnu.yml +65 -0
  14. data/.github/workflows/push_linux_x86_64_gnu.yml +65 -0
  15. data/.github/workflows/push_linux_x86_64_musl.yml +79 -0
  16. data/.github/workflows/push_macos_arm64.yml +54 -0
  17. data/.github/workflows/push_ruby.yml +37 -0
  18. data/.github/workflows/trigger-wiki-refresh.yml +30 -0
  19. data/.github/workflows/verify-action-pins.yml +16 -0
  20. data/.gitignore +16 -0
  21. data/.rspec +3 -0
  22. data/.ruby-gemset +1 -0
  23. data/.ruby-version +1 -0
  24. data/.yardopts +2 -0
  25. data/CHANGELOG.md +344 -0
  26. data/Gemfile +5 -0
  27. data/MIT-LICENSE +22 -0
  28. data/README.md +78 -0
  29. data/Rakefile +96 -0
  30. data/dist/cyrus-sasl-2.1.28.tar.gz +0 -0
  31. data/dist/krb5-1.21.3.tar.gz +0 -0
  32. data/dist/openssl-3.0.16.tar.gz +0 -0
  33. data/dist/zlib-1.3.1.tar.gz +0 -0
  34. data/dist/zstd-1.5.7.tar.gz +0 -0
  35. data/docker-compose-ssl.yml +35 -0
  36. data/docker-compose.yml +25 -0
  37. data/ext/README.md +19 -0
  38. data/ext/Rakefile +131 -0
  39. data/ext/build_common.sh +376 -0
  40. data/ext/build_linux_aarch64_gnu.sh +326 -0
  41. data/ext/build_linux_x86_64_gnu.sh +317 -0
  42. data/ext/build_linux_x86_64_musl.sh +773 -0
  43. data/ext/build_macos_arm64.sh +557 -0
  44. data/ext/generate-ssl-certs.sh +109 -0
  45. data/ext/librdkafka.so +0 -0
  46. data/karafka-rdkafka.gemspec +65 -0
  47. data/lib/rdkafka/abstract_handle.rb +116 -0
  48. data/lib/rdkafka/admin/acl_binding_result.rb +51 -0
  49. data/lib/rdkafka/admin/config_binding_result.rb +30 -0
  50. data/lib/rdkafka/admin/config_resource_binding_result.rb +18 -0
  51. data/lib/rdkafka/admin/create_acl_handle.rb +28 -0
  52. data/lib/rdkafka/admin/create_acl_report.rb +24 -0
  53. data/lib/rdkafka/admin/create_partitions_handle.rb +30 -0
  54. data/lib/rdkafka/admin/create_partitions_report.rb +6 -0
  55. data/lib/rdkafka/admin/create_topic_handle.rb +32 -0
  56. data/lib/rdkafka/admin/create_topic_report.rb +24 -0
  57. data/lib/rdkafka/admin/delete_acl_handle.rb +30 -0
  58. data/lib/rdkafka/admin/delete_acl_report.rb +23 -0
  59. data/lib/rdkafka/admin/delete_groups_handle.rb +28 -0
  60. data/lib/rdkafka/admin/delete_groups_report.rb +24 -0
  61. data/lib/rdkafka/admin/delete_topic_handle.rb +32 -0
  62. data/lib/rdkafka/admin/delete_topic_report.rb +24 -0
  63. data/lib/rdkafka/admin/describe_acl_handle.rb +30 -0
  64. data/lib/rdkafka/admin/describe_acl_report.rb +24 -0
  65. data/lib/rdkafka/admin/describe_configs_handle.rb +33 -0
  66. data/lib/rdkafka/admin/describe_configs_report.rb +48 -0
  67. data/lib/rdkafka/admin/incremental_alter_configs_handle.rb +33 -0
  68. data/lib/rdkafka/admin/incremental_alter_configs_report.rb +48 -0
  69. data/lib/rdkafka/admin.rb +832 -0
  70. data/lib/rdkafka/bindings.rb +583 -0
  71. data/lib/rdkafka/callbacks.rb +415 -0
  72. data/lib/rdkafka/config.rb +395 -0
  73. data/lib/rdkafka/consumer/headers.rb +79 -0
  74. data/lib/rdkafka/consumer/message.rb +86 -0
  75. data/lib/rdkafka/consumer/partition.rb +57 -0
  76. data/lib/rdkafka/consumer/topic_partition_list.rb +190 -0
  77. data/lib/rdkafka/consumer.rb +663 -0
  78. data/lib/rdkafka/error.rb +201 -0
  79. data/lib/rdkafka/helpers/oauth.rb +58 -0
  80. data/lib/rdkafka/helpers/time.rb +14 -0
  81. data/lib/rdkafka/metadata.rb +115 -0
  82. data/lib/rdkafka/native_kafka.rb +139 -0
  83. data/lib/rdkafka/producer/delivery_handle.rb +48 -0
  84. data/lib/rdkafka/producer/delivery_report.rb +45 -0
  85. data/lib/rdkafka/producer/partitions_count_cache.rb +216 -0
  86. data/lib/rdkafka/producer.rb +497 -0
  87. data/lib/rdkafka/version.rb +7 -0
  88. data/lib/rdkafka.rb +54 -0
  89. data/renovate.json +92 -0
  90. data/spec/integrations/ssl_stress_spec.rb +121 -0
  91. data/spec/lib/rdkafka/abstract_handle_spec.rb +117 -0
  92. data/spec/lib/rdkafka/admin/create_acl_handle_spec.rb +56 -0
  93. data/spec/lib/rdkafka/admin/create_acl_report_spec.rb +18 -0
  94. data/spec/lib/rdkafka/admin/create_topic_handle_spec.rb +54 -0
  95. data/spec/lib/rdkafka/admin/create_topic_report_spec.rb +16 -0
  96. data/spec/lib/rdkafka/admin/delete_acl_handle_spec.rb +85 -0
  97. data/spec/lib/rdkafka/admin/delete_acl_report_spec.rb +72 -0
  98. data/spec/lib/rdkafka/admin/delete_topic_handle_spec.rb +54 -0
  99. data/spec/lib/rdkafka/admin/delete_topic_report_spec.rb +16 -0
  100. data/spec/lib/rdkafka/admin/describe_acl_handle_spec.rb +85 -0
  101. data/spec/lib/rdkafka/admin/describe_acl_report_spec.rb +73 -0
  102. data/spec/lib/rdkafka/admin_spec.rb +982 -0
  103. data/spec/lib/rdkafka/bindings_spec.rb +198 -0
  104. data/spec/lib/rdkafka/callbacks_spec.rb +20 -0
  105. data/spec/lib/rdkafka/config_spec.rb +258 -0
  106. data/spec/lib/rdkafka/consumer/headers_spec.rb +73 -0
  107. data/spec/lib/rdkafka/consumer/message_spec.rb +139 -0
  108. data/spec/lib/rdkafka/consumer/partition_spec.rb +57 -0
  109. data/spec/lib/rdkafka/consumer/topic_partition_list_spec.rb +248 -0
  110. data/spec/lib/rdkafka/consumer_spec.rb +1343 -0
  111. data/spec/lib/rdkafka/error_spec.rb +95 -0
  112. data/spec/lib/rdkafka/metadata_spec.rb +79 -0
  113. data/spec/lib/rdkafka/native_kafka_spec.rb +130 -0
  114. data/spec/lib/rdkafka/producer/delivery_handle_spec.rb +60 -0
  115. data/spec/lib/rdkafka/producer/delivery_report_spec.rb +25 -0
  116. data/spec/lib/rdkafka/producer/partitions_count_cache_spec.rb +359 -0
  117. data/spec/lib/rdkafka/producer_spec.rb +1527 -0
  118. data/spec/spec_helper.rb +230 -0
  119. metadata +320 -0
@@ -0,0 +1,271 @@
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 Debian and Ruby versions to ensure broad compatibility and
5
+ # reliability.
6
+ #
7
+ # WHY WE TEST DEBIAN BOOKWORM AND TRIXIE:
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 Debian stable and testing
12
+ # - Different Ruby versions
13
+ # - Forward compatibility testing with Trixie (Debian testing/future stable)
14
+ #
15
+ # COMPILATION FLOW (build_install + specs_install):
16
+ # - Tests that librdkafka compiles correctly from source on both Debian versions
17
+ # - Validates that mini_portile2 can successfully build native dependencies
18
+ # - Ensures Ruby native extensions link properly with system libraries
19
+ # - Verifies that the same codebase works across different toolchain versions
20
+ #
21
+ # PRECOMPILED FLOW (build_precompiled + specs_precompiled):
22
+ # - Tests our precompiled static libraries work on both Debian versions
23
+ # - Validates that statically-linked binaries are truly portable across environments
24
+ # - Ensures precompiled libraries don't have unexpected system dependencies
25
+ # - Verifies that removing build tools doesn't break precompiled binary usage
26
+ #
27
+ # ARTIFACT ISOLATION:
28
+ # - Debian gets separate artifacts (rdkafka-built-gem-debian-bookworm, etc.)
29
+ # - Prevents cross-contamination of OS-specific compiled extensions
30
+ # - Ensures test accuracy by matching build and test environments
31
+ #
32
+ # This comprehensive approach catches issues that single-platform testing would miss,
33
+ # such as system library incompatibilities, compiler-specific bugs, or static linking
34
+ # problems that only manifest on specific Debian versions.
35
+
36
+ name: CI Linux Debian Multi-Version x86_64 GNU
37
+
38
+ concurrency:
39
+ group: ${{ github.workflow }}-${{ github.ref }}
40
+ cancel-in-progress: true
41
+
42
+ on:
43
+ pull_request:
44
+ branches: [ main, master ]
45
+ push:
46
+ branches: [ main, master ]
47
+ schedule:
48
+ - cron: '0 1 * * *'
49
+
50
+ permissions:
51
+ contents: read
52
+
53
+ env:
54
+ BUNDLE_RETRY: 6
55
+ BUNDLE_JOBS: 4
56
+
57
+ jobs:
58
+ specs_install:
59
+ timeout-minutes: 50
60
+ strategy:
61
+ fail-fast: false
62
+ matrix:
63
+ ruby:
64
+ - '3.4'
65
+ - '3.3'
66
+ - '3.2'
67
+ - '3.1'
68
+ debian:
69
+ - 'bookworm'
70
+ - 'trixie'
71
+ exclude:
72
+ - ruby: '3.1'
73
+ debian: 'trixie'
74
+ include:
75
+ - ruby: '3.4'
76
+ coverage: 'true'
77
+ runs-on: ubuntu-latest
78
+ steps:
79
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
80
+ with:
81
+ fetch-depth: 0
82
+
83
+ - name: Start Kafka with Docker Compose
84
+ run: |
85
+ docker compose -f docker-compose.yml up -d
86
+ echo "Waiting for Kafka to be ready..."
87
+ sleep 10
88
+ for i in {1..30}; do
89
+ if docker compose exec -T kafka kafka-topics --bootstrap-server localhost:9092 --list >/dev/null 2>&1; then
90
+ echo "Kafka topics command succeeded!"
91
+ break
92
+ fi
93
+ sleep 2
94
+ done
95
+
96
+ - name: Install dependencies
97
+ env:
98
+ RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
99
+ run: |
100
+ docker run --rm \
101
+ --network host \
102
+ -v "${{ github.workspace }}:/workspace" \
103
+ -w /workspace \
104
+ -e "RDKAFKA_EXT_PATH=/workspace/ext" \
105
+ ruby:${{ matrix.ruby }}-${{ matrix.debian }} \
106
+ sh -c 'apt-get update && \
107
+ apt-get upgrade -y openssl libssl3 libssl-dev && \
108
+ apt-get install -y git build-essential pkg-config \
109
+ libssl-dev libsasl2-dev zlib1g-dev libzstd-dev && \
110
+ git config --global --add safe.directory /workspace && \
111
+ bundle config set --local path vendor/bundle && \
112
+ bundle install'
113
+
114
+ - name: Build gem with mini_portile
115
+ run: |
116
+ docker run --rm \
117
+ --network host \
118
+ -v "${{ github.workspace }}:/workspace" \
119
+ -w /workspace \
120
+ ruby:${{ matrix.ruby }}-${{ matrix.debian }} \
121
+ sh -c 'apt-get update && \
122
+ apt-get upgrade -y openssl libssl3 libssl-dev && \
123
+ apt-get install -y git build-essential pkg-config \
124
+ libssl-dev libsasl2-dev zlib1g-dev libzstd-dev && \
125
+ git config --global --add safe.directory /workspace && \
126
+ bundle config set --local path vendor/bundle && \
127
+ bundle install && \
128
+ cd ext && bundle exec rake'
129
+
130
+ - name: Run all specs in PLAINTEXT
131
+ env:
132
+ GITHUB_COVERAGE: ${{matrix.coverage}}
133
+ RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
134
+ run: |
135
+ docker run --rm \
136
+ --network host \
137
+ -v "${{ github.workspace }}:/workspace" \
138
+ -w /workspace \
139
+ -e "GITHUB_COVERAGE=${{ matrix.coverage }}" \
140
+ -e "RDKAFKA_EXT_PATH=/workspace/ext" \
141
+ ruby:${{ matrix.ruby }}-${{ matrix.debian }} \
142
+ sh -c 'apt-get update && \
143
+ apt-get upgrade -y openssl libssl3 libssl-dev && \
144
+ apt-get install -y git build-essential pkg-config \
145
+ libssl-dev libsasl2-dev zlib1g-dev libzstd-dev && \
146
+ git config --global --add safe.directory /workspace && \
147
+ bundle config set --local path vendor/bundle && \
148
+ bundle install && \
149
+ bundle exec rspec'
150
+
151
+ build_precompiled:
152
+ timeout-minutes: 50
153
+ strategy:
154
+ fail-fast: false
155
+ matrix:
156
+ debian:
157
+ - 'bookworm'
158
+ - 'trixie'
159
+ # We precompile on older Ubuntu and check compatibility by running specs since we aim to
160
+ # release only one precompiled version for all supported Ubuntu versions
161
+ # This is why we do not want Renovate to update it automatically
162
+ runs-on: ubuntu-22.04 # renovate: ignore
163
+ steps:
164
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
165
+ with:
166
+ fetch-depth: 0
167
+ - name: Install build dependencies
168
+ run: |
169
+ sudo apt-get update
170
+ sudo apt-get install -y --no-install-recommends \
171
+ build-essential \
172
+ gcc \
173
+ g++ \
174
+ make \
175
+ tar \
176
+ gzip \
177
+ wget \
178
+ curl \
179
+ file \
180
+ pkg-config \
181
+ autoconf \
182
+ automake \
183
+ libtool \
184
+ python3 \
185
+ git \
186
+ ca-certificates \
187
+ patch \
188
+ libsasl2-dev \
189
+ libssl-dev \
190
+ zlib1g-dev \
191
+ libzstd-dev \
192
+ bison \
193
+ flex \
194
+ perl \
195
+ binutils-dev
196
+ - name: Cache build-tmp directory
197
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
198
+ with:
199
+ path: ext/build-tmp
200
+ key: build-tmp-${{ runner.os }}-${{ matrix.debian }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
201
+ - name: Build precompiled librdkafka.so
202
+ run: |
203
+ cd ext
204
+ ./build_linux_x86_64_gnu.sh
205
+ - name: Upload precompiled library
206
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
207
+ with:
208
+ name: librdkafka-precompiled-linux-${{ matrix.debian }}
209
+ path: ext/
210
+ retention-days: 1
211
+
212
+ specs_precompiled:
213
+ timeout-minutes: 50
214
+ needs: build_precompiled
215
+ strategy:
216
+ fail-fast: false
217
+ matrix:
218
+ ruby:
219
+ - '3.4'
220
+ - '3.3'
221
+ - '3.2'
222
+ - '3.1'
223
+ debian:
224
+ - 'bookworm'
225
+ - 'trixie'
226
+ exclude:
227
+ - ruby: '3.1'
228
+ debian: 'trixie'
229
+ include:
230
+ - ruby: '3.4'
231
+ coverage: 'true'
232
+
233
+ runs-on: ubuntu-latest
234
+ steps:
235
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
236
+ with:
237
+ fetch-depth: 0
238
+ - name: Download precompiled library
239
+ uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
240
+ with:
241
+ name: librdkafka-precompiled-linux-${{ matrix.debian }}
242
+ path: ext/
243
+ - name: Start Kafka with Docker Compose
244
+ run: |
245
+ docker compose -f docker-compose.yml up -d
246
+ echo "Waiting for Kafka to be ready..."
247
+ sleep 10
248
+ for i in {1..30}; do
249
+ if docker compose exec -T kafka kafka-topics --bootstrap-server localhost:9092 --list >/dev/null 2>&1; then
250
+ echo "Kafka topics command succeeded!"
251
+ break
252
+ fi
253
+ sleep 2
254
+ done
255
+ - name: Run specs with precompiled library and PLAINTEXT
256
+ env:
257
+ GITHUB_COVERAGE: ${{ matrix.coverage }}
258
+ RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
259
+ run: |
260
+ docker run --rm \
261
+ --network host \
262
+ -v "${{ github.workspace }}:/workspace" \
263
+ -w /workspace \
264
+ -e "GITHUB_COVERAGE=${{ matrix.coverage }}" \
265
+ -e "RDKAFKA_EXT_PATH=/workspace/ext" \
266
+ ruby:${{ matrix.ruby }}-${{ matrix.debian }} \
267
+ sh -c 'apt-get update && \
268
+ apt-get install -y git && \
269
+ git config --global --add safe.directory /workspace && \
270
+ bundle config set --local path vendor/bundle && \
271
+ bundle install && bundle exec rspec'
@@ -0,0 +1,334 @@
1
+ # CI Strategy: Complementary Testing for SSL and System Library Regressions
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 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:
9
+ # - SSL specs have been stable for 3+ years and rarely break due to code changes
10
+ # - Integration specs test OS library compatibility, which changes with system updates
11
+ # - These tests catch regressions from external changes (OpenSSL updates, system libs)
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
+ # WHY WE TEST DEBIAN BOOKWORM AND TRIXIE:
16
+ # - Different OpenSSL versions and SSL library implementations
17
+ # - Different system library versions that affect SSL handshakes and compatibility
18
+ # - Forward compatibility testing with Trixie (Debian testing/future stable)
19
+ # - Catching SSL regressions from package updates in both stable and testing
20
+ #
21
+ # SSL TESTING (specs_install + specs_precompiled):
22
+ # - Tests SSL/TLS connectivity with Kafka using docker-compose-ssl.yml
23
+ # - Validates certificate handling and SSL handshakes across Ruby and Debian versions
24
+ # - Ensures SSL works with both compiled-from-source and precompiled flows
25
+ # - Catches OpenSSL version compatibility issues and SSL library regressions
26
+ # - Tests real SSL scenarios that mirror production deployments
27
+ #
28
+ # INTEGRATION TESTING (integration specs in both jobs):
29
+ # - Tests system library compatibility without requiring Kafka infrastructure
30
+ # - Validates libssl, libsasl2, libzstd, zlib integration across OS versions
31
+ # - Ensures native extensions work with different system library versions
32
+ # - Catches regressions from Debian package updates and system changes
33
+ # - Tests both compilation and precompiled library compatibility
34
+ #
35
+ # SCHEDULING STRATEGY:
36
+ # - Runs every 3 days at 3 AM to catch system/library changes from base image updates
37
+ # - Triggers on workflow file changes to validate CI modifications
38
+ # - Manual dispatch available for ad-hoc regression testing
39
+ # - Separate artifact naming prevents interference with main CI
40
+ #
41
+ # This approach ensures comprehensive coverage while keeping PR CI fast and focused
42
+ # on code-related issues rather than infrastructure/system regressions.
43
+
44
+ name: CI Linux Complementary Debian Multi-Version x86_64 GNU
45
+
46
+ concurrency:
47
+ group: ${{ github.workflow }}-${{ github.ref }}
48
+ cancel-in-progress: true
49
+
50
+ on:
51
+ schedule:
52
+ - cron: '0 3 */3 * *'
53
+ workflow_dispatch:
54
+ push:
55
+ paths:
56
+ - '.github/workflows/ci_linux_debian_x86_64_gnu_complementary.yml'
57
+ branches: [ main, master ]
58
+ pull_request:
59
+ paths:
60
+ - '.github/workflows/ci_linux_debian_x86_64_gnu_complementary.yml'
61
+ branches: [ main, master ]
62
+
63
+ permissions:
64
+ contents: read
65
+
66
+ env:
67
+ BUNDLE_RETRY: 6
68
+ BUNDLE_JOBS: 4
69
+
70
+ jobs:
71
+ build_precompiled:
72
+ timeout-minutes: 50
73
+ strategy:
74
+ fail-fast: false
75
+ matrix:
76
+ debian:
77
+ - 'bookworm'
78
+ - 'trixie'
79
+ runs-on: ubuntu-22.04 # renovate: ignore
80
+ steps:
81
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
82
+ with:
83
+ fetch-depth: 0
84
+ - name: Install build dependencies
85
+ run: |
86
+ sudo apt-get update
87
+ sudo apt-get install -y --no-install-recommends \
88
+ build-essential \
89
+ gcc \
90
+ g++ \
91
+ make \
92
+ tar \
93
+ gzip \
94
+ wget \
95
+ curl \
96
+ file \
97
+ pkg-config \
98
+ autoconf \
99
+ automake \
100
+ libtool \
101
+ python3 \
102
+ git \
103
+ ca-certificates \
104
+ patch \
105
+ libsasl2-dev \
106
+ libssl-dev \
107
+ zlib1g-dev \
108
+ libzstd-dev \
109
+ bison \
110
+ flex \
111
+ perl \
112
+ binutils-dev
113
+ - name: Cache build-tmp directory
114
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
115
+ with:
116
+ path: ext/build-tmp
117
+ key: build-tmp-complementary-${{ runner.os }}-${{ matrix.debian }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
118
+ - name: Build precompiled librdkafka.so
119
+ run: |
120
+ cd ext
121
+ ./build_linux_x86_64_gnu.sh
122
+ - name: Upload precompiled library
123
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
124
+ with:
125
+ name: librdkafka-precompiled-linux-complementary-${{ matrix.debian }}
126
+ path: ext/
127
+ retention-days: 1
128
+
129
+ specs_install:
130
+ timeout-minutes: 50
131
+ strategy:
132
+ fail-fast: false
133
+ matrix:
134
+ ruby:
135
+ - '3.4'
136
+ - '3.3'
137
+ - '3.2'
138
+ - '3.1'
139
+ debian:
140
+ - 'bookworm'
141
+ - 'trixie'
142
+ exclude:
143
+ - ruby: '3.1'
144
+ debian: 'trixie'
145
+ runs-on: ubuntu-latest
146
+ steps:
147
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
148
+ with:
149
+ fetch-depth: 0
150
+
151
+ - name: Start Kafka with Docker Compose
152
+ run: |
153
+ ./ext/generate-ssl-certs.sh
154
+ docker compose -f docker-compose-ssl.yml up -d
155
+ echo "Waiting for Kafka to be ready..."
156
+ sleep 10
157
+ for i in {1..30}; do
158
+ if docker compose exec -T kafka kafka-topics --bootstrap-server localhost:9092 --list >/dev/null 2>&1; then
159
+ echo "Kafka topics command succeeded!"
160
+ break
161
+ fi
162
+ sleep 2
163
+ done
164
+
165
+ - name: Install dependencies
166
+ env:
167
+ RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
168
+ run: |
169
+ docker run --rm \
170
+ --network host \
171
+ -v "${{ github.workspace }}:/workspace" \
172
+ -w /workspace \
173
+ -e "RDKAFKA_EXT_PATH=/workspace/ext" \
174
+ ruby:${{ matrix.ruby }}-${{ matrix.debian }} \
175
+ sh -c 'apt-get update && \
176
+ apt-get upgrade -y openssl libssl3 libssl-dev && \
177
+ apt-get install -y git build-essential pkg-config \
178
+ libssl-dev libsasl2-dev zlib1g-dev libzstd-dev && \
179
+ git config --global --add safe.directory /workspace && \
180
+ bundle config set --local path vendor/bundle && \
181
+ bundle install'
182
+
183
+ - name: Build gem with mini_portile
184
+ run: |
185
+ docker run --rm \
186
+ --network host \
187
+ -v "${{ github.workspace }}:/workspace" \
188
+ -w /workspace \
189
+ ruby:${{ matrix.ruby }}-${{ matrix.debian }} \
190
+ sh -c 'apt-get update && \
191
+ apt-get upgrade -y openssl libssl3 libssl-dev && \
192
+ apt-get install -y git build-essential pkg-config \
193
+ libssl-dev libsasl2-dev zlib1g-dev libzstd-dev && \
194
+ git config --global --add safe.directory /workspace && \
195
+ bundle config set --local path vendor/bundle && \
196
+ bundle install && \
197
+ cd ext && bundle exec rake'
198
+
199
+ - name: Run all specs in SSL (compiled flow)
200
+ env:
201
+ RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
202
+ KAFKA_SSL_ENABLED: "true"
203
+ run: |
204
+ docker run --rm \
205
+ --network host \
206
+ -v "${{ github.workspace }}:/workspace" \
207
+ -w /workspace \
208
+ -e "RDKAFKA_EXT_PATH=/workspace/ext" \
209
+ -e "KAFKA_SSL_ENABLED=true" \
210
+ ruby:${{ matrix.ruby }}-${{ matrix.debian }} \
211
+ sh -c 'apt-get update && \
212
+ apt-get upgrade -y openssl libssl3 libssl-dev && \
213
+ apt-get install -y git build-essential pkg-config \
214
+ libssl-dev libsasl2-dev zlib1g-dev libzstd-dev default-jdk && \
215
+ git config --global --add safe.directory /workspace && \
216
+ bundle config set --local path vendor/bundle && \
217
+ bundle install && \
218
+ echo "=== SSL Library Versions (${{ matrix.debian }}) ===" && \
219
+ openssl version && \
220
+ dpkg -l | grep -E "(libssl|openssl)" && \
221
+ echo "=== Running SSL Specs (Compiled) ===" && \
222
+ bundle exec rspec'
223
+
224
+ - name: Run integration specs (compiled flow)
225
+ run: |
226
+ docker run --rm \
227
+ -v "${{ github.workspace }}:/workspace" \
228
+ -w /workspace \
229
+ ruby:${{ matrix.ruby }}-${{ matrix.debian }} \
230
+ sh -c 'apt-get update && \
231
+ apt-get upgrade -y openssl libssl3 libssl-dev && \
232
+ apt-get install -y git build-essential pkg-config \
233
+ libssl-dev libsasl2-dev zlib1g-dev libzstd-dev libcurl4-openssl-dev libcurl4 && \
234
+ git config --global --add safe.directory /workspace && \
235
+ bundle config set --local path vendor/bundle && \
236
+ bundle install && \
237
+ echo "=== OS Library Versions (${{ matrix.debian }}) ===" && \
238
+ openssl version && \
239
+ dpkg -l | grep -E "(libssl|libsasl|libzstd|zlib)" && \
240
+ echo "=== Running Integration Specs (Compiled) ===" && \
241
+ for file in $(ls spec/integrations/*_spec.rb); do \
242
+ echo "Running $file with Ruby ${{ matrix.ruby }} on ${{ matrix.debian }}"; \
243
+ bundle exec ruby "$file" || exit 1; \
244
+ done'
245
+
246
+ specs_precompiled:
247
+ timeout-minutes: 50
248
+ needs: build_precompiled
249
+ strategy:
250
+ fail-fast: false
251
+ matrix:
252
+ ruby:
253
+ - '3.4'
254
+ - '3.3'
255
+ - '3.2'
256
+ - '3.1'
257
+ debian:
258
+ - 'bookworm'
259
+ - 'trixie'
260
+ exclude:
261
+ - ruby: '3.1'
262
+ debian: 'trixie'
263
+ runs-on: ubuntu-latest
264
+ steps:
265
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
266
+ with:
267
+ fetch-depth: 0
268
+ - name: Download precompiled library
269
+ uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
270
+ with:
271
+ name: librdkafka-precompiled-linux-complementary-${{ matrix.debian }}
272
+ path: ext/
273
+
274
+ - name: Start Kafka with Docker Compose
275
+ run: |
276
+ ./ext/generate-ssl-certs.sh
277
+ docker compose -f docker-compose-ssl.yml up -d
278
+ echo "Waiting for Kafka to be ready..."
279
+ sleep 10
280
+ for i in {1..30}; do
281
+ if docker compose exec -T kafka kafka-topics --bootstrap-server localhost:9092 --list >/dev/null 2>&1; then
282
+ echo "Kafka topics command succeeded!"
283
+ break
284
+ fi
285
+ sleep 2
286
+ done
287
+
288
+ - name: Run specs with precompiled library and SSL
289
+ env:
290
+ RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
291
+ KAFKA_SSL_ENABLED: "true"
292
+ run: |
293
+ docker run --rm \
294
+ --network host \
295
+ -v "${{ github.workspace }}:/workspace" \
296
+ -w /workspace \
297
+ -e "RDKAFKA_EXT_PATH=/workspace/ext" \
298
+ -e "KAFKA_SSL_ENABLED=true" \
299
+ ruby:${{ matrix.ruby }}-${{ matrix.debian }} \
300
+ sh -c 'apt-get update && \
301
+ apt-get install -y git default-jdk && \
302
+ git config --global --add safe.directory /workspace && \
303
+ bundle config set --local path vendor/bundle && \
304
+ bundle install && \
305
+ echo "=== SSL Library Versions (${{ matrix.debian }}) ===" && \
306
+ openssl version && \
307
+ dpkg -l | grep -E "(libssl|openssl)" && \
308
+ echo "=== Running SSL Specs (Precompiled) ===" && \
309
+ bundle exec rspec'
310
+
311
+ - name: Run integration specs (precompiled flow)
312
+ env:
313
+ RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
314
+ run: |
315
+ docker run --rm \
316
+ -v "${{ github.workspace }}:/workspace" \
317
+ -w /workspace \
318
+ -e "RDKAFKA_EXT_PATH=/workspace/ext" \
319
+ ruby:${{ matrix.ruby }}-${{ matrix.debian }} \
320
+ sh -c 'apt-get update && \
321
+ apt-get upgrade -y openssl libssl3 libssl-dev && \
322
+ apt-get install -y git build-essential pkg-config \
323
+ libssl-dev libsasl2-dev zlib1g-dev libzstd-dev libcurl4-openssl-dev libcurl4 && \
324
+ git config --global --add safe.directory /workspace && \
325
+ bundle config set --local path vendor/bundle && \
326
+ bundle install && \
327
+ echo "=== OS Library Versions (${{ matrix.debian }}) ===" && \
328
+ openssl version && \
329
+ dpkg -l | grep -E "(libssl|libsasl|libzstd|zlib)" && \
330
+ echo "=== Running Integration Specs (Precompiled) ===" && \
331
+ for file in $(ls spec/integrations/*_spec.rb); do \
332
+ echo "Running $file with Ruby ${{ matrix.ruby }} on ${{ matrix.debian }} (precompiled)"; \
333
+ bundle exec ruby "$file" || exit 1; \
334
+ done'