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
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d08c840995a461c4579864410d6bc42db5ab30a13494f23413c4f60a6d29338f
4
+ data.tar.gz: a4563f6a1438b8e7b3f44fd1a5e760ca74daca92f7d16376dd15ca4a2d64b316
5
+ SHA512:
6
+ metadata.gz: 692d1e0036873a05b28b48344d12a1143328d93b5397545d3810962bd29d9cd64f91a75f8fbe78d906f9f5232a4fa8b92a78f389e9cef42f923777f661aa9415
7
+ data.tar.gz: 97119c4aa755ce8caf380212039a7a682b64ffe3f27fd968e9c3232a2756030286f687b92555ad5168f89251b63a3324f712a23d3a001ff6924eda66515fce21
@@ -0,0 +1,3 @@
1
+ /.github @mensfeld
2
+ /.github/workflows/ @mensfeld
3
+ /.github/actions/ @mensfeld
@@ -0,0 +1 @@
1
+ custom: ['https://karafka.io/#become-pro']
@@ -0,0 +1,197 @@
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
25
+
26
+ concurrency:
27
+ group: ${{ github.workflow }}-${{ github.ref }}
28
+ cancel-in-progress: true
29
+
30
+ on:
31
+ pull_request:
32
+ branches: [ main, master ]
33
+ push:
34
+ branches: [ main, master ]
35
+ schedule:
36
+ - cron: '0 1 * * *'
37
+
38
+ permissions:
39
+ contents: read
40
+
41
+ env:
42
+ BUNDLE_RETRY: 6
43
+ BUNDLE_JOBS: 4
44
+
45
+ jobs:
46
+ specs_install:
47
+ timeout-minutes: 45
48
+ runs-on: ubuntu-latest
49
+ strategy:
50
+ fail-fast: false
51
+ matrix:
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'
66
+ - ruby: '3.4'
67
+ alpine_version: '3.22'
68
+ coverage: 'true'
69
+ steps:
70
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
71
+ with:
72
+ fetch-depth: 0
73
+
74
+ - name: Start Kafka with Docker Compose
75
+ run: |
76
+ docker compose -f docker-compose.yml up -d
77
+ echo "Waiting for Kafka to be ready..."
78
+ sleep 10
79
+ for i in {1..30}; do
80
+ if docker compose exec -T kafka kafka-topics --bootstrap-server localhost:9092 --list >/dev/null 2>&1; then
81
+ echo "Kafka topics command succeeded!"
82
+ break
83
+ fi
84
+ sleep 2
85
+ done
86
+
87
+ - name: Run all specs in PLAINTEXT
88
+ env:
89
+ GITHUB_COVERAGE: ${{ matrix.coverage }}
90
+ run: |
91
+ docker run --rm \
92
+ --network host \
93
+ -v "${{ github.workspace }}:/workspace" \
94
+ -w /workspace \
95
+ -e "GITHUB_COVERAGE=${{ matrix.coverage }}" \
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 && \
103
+ git config --global --add safe.directory /workspace && \
104
+ bundle config set --local path vendor/bundle && \
105
+ bundle install && \
106
+ cd ext && bundle exec rake && \
107
+ cd .. && \
108
+ bundle exec ruby -S rspec'
109
+
110
+ build_precompiled:
111
+ timeout-minutes: 45
112
+ runs-on: ubuntu-latest
113
+ container:
114
+ # Similar to GNU, we build on the oldest for ABI compatibility
115
+ image: alpine:3.18@sha256:de0eb0b3f2a47ba1eb89389859a9bd88b28e82f5826b6969ad604979713c2d4f # renovate: ignore
116
+ steps:
117
+ - name: Install dependencies
118
+ run: |
119
+ apk add --no-cache git curl ca-certificates build-base linux-headers \
120
+ pkgconf perl autoconf automake libtool bison flex file bash wget zstd-dev \
121
+ openssl-dev cyrus-sasl-dev cyrus-sasl cyrus-sasl-login \
122
+ cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-gssapiv2 cyrus-sasl-scram \
123
+ krb5-libs openssl zlib zlib-dev zstd-libs
124
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
125
+ with:
126
+ fetch-depth: 0
127
+ - name: Configure git safe directory
128
+ run: git config --global --add safe.directory /__w/karafka-rdkafka/karafka-rdkafka
129
+ - name: Cache build-tmp directory
130
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
131
+ with:
132
+ path: ext/build-tmp-musl
133
+ key: build-tmp-musl-${{ runner.os }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
134
+ - name: Build precompiled librdkafka.so
135
+ run: |
136
+ cd ext
137
+ bash ./build_linux_x86_64_musl.sh
138
+ - name: Upload precompiled library
139
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
140
+ with:
141
+ name: librdkafka-precompiled-musl
142
+ path: ext/
143
+ retention-days: 1
144
+
145
+ specs_precompiled:
146
+ timeout-minutes: 30
147
+ runs-on: ubuntu-latest
148
+ needs: build_precompiled
149
+ strategy:
150
+ fail-fast: false
151
+ matrix:
152
+ ruby:
153
+ - '3.4'
154
+ - '3.3'
155
+ - '3.2'
156
+ - '3.1'
157
+ include:
158
+ - ruby: '3.4'
159
+ coverage: 'true'
160
+ steps:
161
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
162
+ with:
163
+ fetch-depth: 0
164
+ - name: Download precompiled library
165
+ uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
166
+ with:
167
+ name: librdkafka-precompiled-musl
168
+ path: ext/
169
+ - name: Start Kafka with Docker Compose
170
+ run: |
171
+ docker compose -f docker-compose.yml up -d
172
+ echo "Waiting for Kafka to be ready..."
173
+ sleep 10
174
+
175
+ for i in {1..30}; do
176
+ if docker compose exec -T kafka kafka-topics --bootstrap-server localhost:9092 --list >/dev/null 2>&1; then
177
+ echo "Kafka topics command succeeded!"
178
+ break
179
+ fi
180
+ sleep 2
181
+ done
182
+ - name: Run specs with precompiled library and PLAINTEXT
183
+ env:
184
+ GITHUB_COVERAGE: ${{ matrix.coverage }}
185
+ RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
186
+ run: |
187
+ docker run --rm \
188
+ --network host \
189
+ -v "${{ github.workspace }}:/workspace" \
190
+ -w /workspace \
191
+ -e "GITHUB_COVERAGE=${{ matrix.coverage }}" \
192
+ -e "RDKAFKA_EXT_PATH=/workspace/ext" \
193
+ ruby:${{ matrix.ruby }}-alpine \
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'