-
Notifications
You must be signed in to change notification settings - Fork 56
264 lines (253 loc) · 8.63 KB
/
debug.yml
File metadata and controls
264 lines (253 loc) · 8.63 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
name: tests
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:
source:
runs-on: ubuntu-22.04
outputs:
gem_version: ${{ steps.build_gem.outputs.gem_version }}
steps:
- 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/**/*
build_macos_x86_64:
needs: 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
run: |
echo "System OpenSSL:"
/usr/bin/otool -L /usr/lib/libssl.48.dylib 2>/dev/null || echo "libssl.48.dylib not found via otool"
openssl version || echo "OpenSSL command not found"
ls -la /usr/lib/libssl* || echo "No system libssl*"
- 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 support: ' + (ctx.respond_to?(:min_version) ? ctx.min_version.inspect : 'No')
puts 'SSLContext max_version support: ' + (ctx.respond_to?(:max_version) ? ctx.max_version.inspect : 'No')
puts 'SSL library: ' + OpenSSL::OPENSSL_LIBRARIES.inspect
puts 'SSL config file: ' + OpenSSL::OPENSSL_CONF.inspect
"
- 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']
rescue OpenSSL::SSL::SSLError => e
puts 'SSL Error: ' + e.message
rescue => e
puts 'Error: ' + e.class.name + ' - ' + e.message
end
"
build_macos_x86_64:
needs: 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.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.source.outputs.gem_version }}.gem
- uses: actions/upload-artifact@v4
with:
retention-days: 1
name: couchbase-${{ needs.source.outputs.gem_version }}-x86_64-darwin-${{ matrix.ruby }}
path: |
*-x86_64-darwin*.gem
repackage_macos_x86_64:
needs:
- source
- build_macos_x86_64
runs-on: macos-15-intel
steps:
- uses: actions/download-artifact@v4
with:
name: scripts-${{ needs.source.outputs.gem_version }}
- uses: actions/download-artifact@v4
with:
path: pkg/binary/3.1
name: couchbase-${{ needs.source.outputs.gem_version }}-x86_64-darwin-3.1
- uses: actions/download-artifact@v4
with:
path: pkg/binary/3.2
name: couchbase-${{ needs.source.outputs.gem_version }}-x86_64-darwin-3.2
- uses: actions/download-artifact@v4
with:
path: pkg/binary/3.3
name: couchbase-${{ needs.source.outputs.gem_version }}-x86_64-darwin-3.3
- uses: actions/download-artifact@v4
with:
path: pkg/binary/3.4
name: couchbase-${{ needs.source.outputs.gem_version }}-x86_64-darwin-3.4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4
- name: Repackage
run: |
ruby bin/jenkins/repackage-extension.rb
- uses: actions/upload-artifact@v4
with:
name: couchbase-${{ needs.source.outputs.gem_version }}-x86_64-darwin
path: |
pkg/fat/*.gem
mock_macos_x86_64:
timeout-minutes: 15
needs:
- source
- 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.source.outputs.gem_version }}-x86_64-darwin
- uses: actions/download-artifact@v4
with:
name: scripts-${{ needs.source.outputs.gem_version }}
- uses: actions/download-artifact@v4
with:
name: tests-${{ needs.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: Test
env:
CB_CAVES_LOGS_DIR: caves-logs
COUCHBASE_BACKEND_DONT_WRITE_TO_STDERR: true
COUCHBASE_BACKEND_LOG_PATH: logs/couchbase.log
run: |
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