-
Notifications
You must be signed in to change notification settings - Fork 56
286 lines (272 loc) · 10.2 KB
/
debug.yml
File metadata and controls
286 lines (272 loc) · 10.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
name: debug
permissions: {}
on:
push:
branches:
- main
- release*
pull_request:
branches:
- main
- release*
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
debug_source:
runs-on: ubuntu-22.04
outputs:
gem_version: ${{ steps.build_gem.outputs.gem_version }}
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
fetch-tags: true
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
- name: Build
id: build_gem
run: |
COMMITS_SINCE_LAST_TAG=$(git describe --tags --always --long | awk -F '-' '{print $2}')
ruby bin/jenkins/patch-version.rb ${COMMITS_SINCE_LAST_TAG}
GEM_VERSION=$(ruby -r ./lib/couchbase/version.rb -e "puts Couchbase::VERSION[:sdk]")
echo "gem_version=${GEM_VERSION}" >> "$GITHUB_OUTPUT"
bundle exec rake build
- name: RDoc
run: |
cat > patch-readme.rb <<EOF
require_relative "./lib/couchbase/version.rb"
gemfile = <<EOS.strip
gem "couchbase", "#{Couchbase::VERSION[:sdk]}"
EOS
old_content = File.read("README.md")
new_content = old_content.gsub(/(gem "couchbase", ").*?"/, gemfile)
File.write("README.md", new_content)
EOF
ruby patch-readme.rb
bundle exec yard doc --hide-api private --output-dir docs/couchbase-ruby-client-${{ steps.build_gem.outputs.gem_version }} lib --main README.md
- uses: actions/upload-artifact@v4
with:
name: couchbase-${{ steps.build_gem.outputs.gem_version }}
path: |
pkg/*.gem
- uses: actions/upload-artifact@v4
with:
retention-days: 1
name: scripts-${{ steps.build_gem.outputs.gem_version }}
path: |
Gemfile
Rakefile
bin/**/*
couchbase.gemspec
lib/couchbase/version.rb
task/**/*
- uses: actions/upload-artifact@v4
with:
retention-days: 1
name: tests-${{ steps.build_gem.outputs.gem_version }}
path: |
test/**/*
test_data/**/*
- uses: actions/upload-artifact@v4
with:
name: docs-${{ steps.build_gem.outputs.gem_version }}
path: |
docs/**/*
debug_verify_openssl:
needs: debug_source
runs-on: macos-15-intel
strategy:
fail-fast: false
matrix:
ruby:
- '3.3'
steps:
- uses: hendrikmuhs/ccache-action@v1.2
with:
max-size: 2G
key: ${{ github.job }}-${{ matrix.ruby }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Check system OpenSSL & Homebrew
run: |
echo "macOS version:"
/usr/bin/sw_vers
echo "--- System OpenSSL:"
find /usr/lib -name '*ssl*' -type f 2>/dev/null | head -10 || echo "No system ssl libs found"
ls -la /usr/lib/libssl* /System/Library/Frameworks/Security.framework/libssl* 2>/dev/null || echo "No explicit libssl*"
openssl version || echo "OpenSSL CLI not found"
echo "--- Homebrew OpenSSL:"
ls -la /opt/homebrew/lib/libssl* /usr/local/lib/libssl* 2>/dev/null || echo "No Homebrew libssl"
echo "--- Ruby lib path (for native exts):"
ruby -e 'puts RbConfig::CONFIG["libdir"] + "/ruby/" + RbConfig::CONFIG["ruby_version"]'
- name: Check Ruby OpenSSL
run: |
ruby -r openssl -e "
puts 'Ruby OpenSSL version: ' + OpenSSL::OPENSSL_VERSION
ctx = OpenSSL::SSL::SSLContext.new
puts 'SSLContext min_version: ' + (ctx.respond_to?(:min_version) ? ctx.min_version.to_s : 'unsupported')
puts 'SSLContext max_version: ' + (ctx.respond_to?(:max_version) ? ctx.max_version.to_s : 'unsupported')
puts 'SSL config file: ' + (defined?(OpenSSL::OPENSSL_CONF) ? OpenSSL::OPENSSL_CONF.to_s : 'undefined')
begin
engines = OpenSSL::Engine.engines
puts 'Loaded OpenSSL engines: ' + engines.map(&:name).join(', ')
rescue NameError
puts 'OpenSSL::Engine unavailable'
end
" || echo "Ruby OpenSSL check completed (ignore NameError)"
- name: Test OpenSSL HTTPS fetch
run: |
ruby -e "
require 'net/http'; require 'uri'; require 'openssl'
uri = URI('https://www.couchbase.com/')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
begin
response = http.get(uri.path.empty? ? '/' : uri.path)
puts 'SUCCESS: HTTP ' + response.code + ' - ' + response['content-type']
puts 'SSL handshake OK - OpenSSL functional'
rescue OpenSSL::SSL::SSLError => e
puts 'SSL Error: ' + e.message
rescue => e
puts 'Error: ' + e.class.name + ' - ' + e.message
end
"
debug_build_macos_x86_64:
needs: debug_source
runs-on: macos-15-intel
strategy:
fail-fast: false
matrix:
ruby:
- '3.3'
steps:
- uses: hendrikmuhs/ccache-action@v1.2
with:
max-size: 2G
key: ${{ github.job }}-${{ matrix.ruby }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- uses: actions/download-artifact@v4
with:
name: couchbase-${{ needs.debug_source.outputs.gem_version }}
- name: Precompile
env:
CB_STATIC_BORINGSSL: 1
CB_STATIC_STDLIB: 1
CB_REMOVE_EXT_DIRECTORY: 1
run: |
gem install gem-compiler
gem compile --prune couchbase-${{ needs.debug_source.outputs.gem_version }}.gem
- uses: actions/upload-artifact@v4
with:
retention-days: 1
name: couchbase-${{ needs.debug_source.outputs.gem_version }}-x86_64-darwin-${{ matrix.ruby }}
path: |
*-x86_64-darwin*.gem
debug_repackage_macos_x86_64:
needs:
- debug_source
- debug_build_macos_x86_64
runs-on: macos-15-intel
steps:
- uses: actions/download-artifact@v4
with:
name: scripts-${{ needs.debug_source.outputs.gem_version }}
- uses: actions/download-artifact@v4
with:
path: pkg/binary/3.3
name: couchbase-${{ needs.debug_source.outputs.gem_version }}-x86_64-darwin-3.3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
- name: Repackage
run: |
ruby bin/jenkins/repackage-extension.rb
- uses: actions/upload-artifact@v4
with:
name: couchbase-${{ needs.debug_source.outputs.gem_version }}-x86_64-darwin
path: |
pkg/fat/*.gem
debug_mock_macos_x86_64:
timeout-minutes: 15
needs:
- debug_source
- debug_repackage_macos_x86_64
runs-on: macos-15-intel
strategy:
fail-fast: false
matrix:
ruby:
- '3.3'
steps:
- uses: actions/download-artifact@v4
with:
name: couchbase-${{ needs.debug_source.outputs.gem_version }}-x86_64-darwin
- uses: actions/download-artifact@v4
with:
name: scripts-${{ needs.debug_source.outputs.gem_version }}
- uses: actions/download-artifact@v4
with:
name: tests-${{ needs.debug_source.outputs.gem_version }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install
run: |
COUCHBASE_GEM_PATH=$(realpath couchbase-*.gem)
UNPACKED_GEM_PATH=$(gem unpack ${COUCHBASE_GEM_PATH} | grep "Unpacked gem" | cut -d "'" -f 2)
gem unpack --spec --target ${UNPACKED_GEM_PATH} ${COUCHBASE_GEM_PATH}
ruby -i.bak -pe "gsub(/gemspec/, 'gem \"couchbase\", path: \"${UNPACKED_GEM_PATH}\"')" Gemfile
bundle install
bundle exec ruby -r bundler/setup -r couchbase -e 'pp Couchbase::VERSION, Couchbase::BUILD_INFO'
- name: Check dependencies
run: |
otool -L /Users/runner/hostedtoolcache/Ruby/3.3.10/x64/lib/libruby.3.3.dylib
otool -L $(find $(bundle show couchbase) -name '*.so' -o -name '*.dylib' -o -name '*.bundle') 2>/dev/null
otool -L $(find $(bundle show openssl) -name '*.so' -o -name '*.dylib' -o -name '*.bundle') 2>/dev/null
echo $DYLD_LIBRARY_PATH
echo $LD_LIBRARY_PATH
echo $PATH
export DYLD_LIBRARY_PATH="/usr/local/lib:/opt/homebrew/lib:$DYLD_LIBRARY_PATH"
export LD_LIBRARY_PATH="/usr/local/lib:/opt/homebrew/lib:$LD_LIBRARY_PATH"
otool -L /Users/runner/hostedtoolcache/Ruby/3.3.10/x64/lib/libruby.3.3.dylib
otool -L $(find $(bundle show couchbase) -name '*.so' -o -name '*.dylib' -o -name '*.bundle') 2>/dev/null
otool -L $(find $(bundle show openssl) -name '*.so' -o -name '*.dylib' -o -name '*.bundle') 2>/dev/null
- name: Test
env:
CB_CAVES_LOGS_DIR: caves-logs
COUCHBASE_BACKEND_DONT_WRITE_TO_STDERR: true
COUCHBASE_BACKEND_LOG_PATH: logs/couchbase.log
run: |
export DYLD_LIBRARY_PATH="/usr/local/lib:/opt/homebrew/lib:$DYLD_LIBRARY_PATH"
export LD_LIBRARY_PATH="/usr/local/lib:/opt/homebrew/lib:$LD_LIBRARY_PATH"
bundle exec rake test
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: ${{ github.job }}-${{ github.run_attempt }}-${{ matrix.ruby }}-logs
path: |
caves-logs/*
logs/*
test/**/*.{log,xml}
retention-days: 5
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4.1.0
if: always()
with:
check_name: 🍏caves, ruby-${{ matrix.ruby }}
report_paths: test/reports/*.xml
require_tests: true
annotate_only: true