-
Notifications
You must be signed in to change notification settings - Fork 5
404 lines (353 loc) · 11.9 KB
/
release.yml
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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
# CI wxRuby release workflow
name: Release build
on:
push:
tags:
- v*
paths-ignore:
- '.github/workflows/**'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
release:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
ruby: '3.2'
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} wxRuby Release (${{ github.ref_name }})
env:
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
outputs:
version: ${{ steps.version_var.outputs.WXRUBY_VERSION }}
prerelease: ${{ steps.version_var.outputs.WXRUBY_PRERELEASE }}
steps:
- name: Checkout wxRuby3
uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
if: ${{ github.event_name != 'workflow_dispatch' }}
with:
ruby-version: ${{ matrix.ruby }}
- name: Setup Ruby gems
if: ${{ github.event_name != 'workflow_dispatch' }}
run: |
bundle install
- name: Build wxRuby3 gem
if: ${{ github.event_name != 'workflow_dispatch' }}
run: |
bundle exec rake gem
- name: Upload gem to release
if: ${{ github.event_name != 'workflow_dispatch' }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: pkg/*.gem
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Publish Gem on RubyGems
if: ${{ github.event_name != 'workflow_dispatch' }}
run: |
gem push pkg/*.gem
- name: Set version variables
id: version_var
run: |
echo "WXRUBY_VERSION=${GITHUB_REF_NAME/#v/}" >> "$GITHUB_OUTPUT"
if grep -q "\-[a-zA-Z]" <<< "$GITHUB_REF_NAME" ; then
echo "WXRUBY_PRERELEASE=1" >> "$GITHUB_OUTPUT"
else
echo "WXRUBY_PRERELEASE=0" >> "$GITHUB_OUTPUT"
fi
verify-gem:
needs: release
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
gtk_version: 3
CC: gcc-12
CXX: g++-12
ruby: '3.2'
wxWidgets: '3.2.4'
swig: '4'
configure_flags:
use_xvfb: true
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} wxRuby Gem Test (${{ github.ref_name }})
env:
WXWIDGETS_ROOT: ${{ github.workspace }}/ext/wxWidgets
WXWIN_INSTALL: ${{ github.workspace }}/ext/wxWidgets/install
wxGTK_VERSION: ${{ matrix.gtk_version && matrix.gtk_version || 3 }}
wxCONFIGURE_FLAGS: ${{ matrix.configure_flags }}
wxUSE_ASAN: ${{ matrix.use_asan && 1 || 0 }}
wxUSE_XVFB: ${{ matrix.use_xvfb && 1 || 0 }}
WX_EXTRA_PACKAGES: doxygen patchelf
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
WXRUBY_VERSION: ${{ needs.release.outputs.version }}
WXRUBY_PRERELEASE: ${{ needs.release.outputs.prerelease }}
steps:
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: checkout wxWidgets
uses: actions/checkout@v4
with:
repository: wxWidgets/wxWidgets
path: ${{ env.WXWIDGETS_ROOT }}
ref: v${{ matrix.wxWidgets }}
submodules: 'recursive'
- name: Set up build environment
run: |
# Install locales used by our tests to run all the tests instead of
# skipping them.
sudo locale-gen de_DE.utf8 de_CH.utf8 en_US.utf8 fr_FR.utf8 sv_SE.utf8
$WXWIDGETS_ROOT/build/tools/before_install.sh
- name: Display build environment
run: |
echo $PATH
ruby -v
doxygen -v
gcc -v
g++ -v
- name: Configuring wxWidgets
working-directory: ${{ env.WXWIDGETS_ROOT }}
run: |
wxCONFIGURE_OPTIONS="$wxCONFIGURE_FLAGS"
if [ -n "${{ matrix.gtk_version }}" ]; then
wxCONFIGURE_OPTIONS="--with-gtk=${{ matrix.gtk_version }} $wxCONFIGURE_OPTIONS"
fi
./configure $wxCONFIGURE_OPTIONS --disable-tests --without-subdirs --disable-debug_info || rc=$?
if [ -n "$rc" ]; then
echo '*** Configuring failed, contents of config.log follows: ***'
echo '-----------------------------------------------------------'
cat $WXWIDGETS_ROOT/config.log
echo '-----------------------------------------------------------'
exit $rc
fi
- name: Build and install wxWidgets
working-directory: ${{ env.WXWIDGETS_ROOT }}
run: |
make && sudo make install && sudo ldconfig
- name: Remove wxWidgets
run: |
rm -rf $WXWIDGETS_ROOT
- name: Install wxRuby3 gem
run: |
if [ "$WXRUBY_PRERELEASE" == "1" ]; then
BUILD_CMD="gem install wxruby3 -v $WXRUBY_VERSION --pre"
else
BUILD_CMD="gem install wxruby3 -v $WXRUBY_VERSION"
fi
/bin/bash -o pipefail -c "xvfb-run -a -s '-screen 0 1600x1200x24' $BUILD_CMD 2>&1 | tee -a gembuild.out" || rc=$?
if [ -n "$rc" ]; then
if fgrep -q '(core dumped)' gembuild.out; then
echo '*** Test crashed, trying to get more information ***'
gdb --quiet --core=core -ex 'where' -ex 'thread apply all bt' -ex 'q' --args $BUILD_CMD
fi
exit $rc
fi
- name: Run wxRuby3 regression tests
run: |
ulimit -c unlimited
TEST_CMD="wxruby test"
/bin/bash -o pipefail -c "xvfb-run -a -s '-screen 0 1600x1200x24' $TEST_CMD 2>&1 | tee -a wxtest.out" || rc=$?
if [ -n "$rc" ]; then
if fgrep -q '(core dumped)' wxtest.out; then
echo '*** Test crashed, trying to get more information ***'
gdb --quiet --core=core -ex 'where' -ex 'thread apply all bt' -ex 'q' --args $TEST_CMD
fi
exit $rc
fi
verify-gem-mac:
needs: release
strategy:
fail-fast: false
matrix:
include:
- name: wxMac macOS 13
runner: macos-13
arch: x86_64
wxWidgets: '3.2.4'
ruby: '3.2'
swig: '4'
configure_flags: --disable-sys-libs
runs-on: ${{ matrix.runner }}
name: ${{ matrix.name }} wxRuby Gem Test (${{ github.ref_name }})
env:
NSUnbufferedIO: YES
WXWIDGETS_ROOT: ${{ github.workspace }}/ext/wxWidgets
WXWIN_INSTALL: ${{ github.workspace }}/ext/wxWidgets/install
WXRUBY_VERSION: ${{ needs.release.outputs.version }}
WXRUBY_PRERELEASE: ${{ needs.release.outputs.prerelease }}
steps:
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: checkout wxWidgets
uses: actions/checkout@v4
with:
repository: wxWidgets/wxWidgets
path: ${{ env.WXWIDGETS_ROOT }}
ref: v${{ matrix.wxWidgets }}
- name: Set environment variables
run: |
echo TZ=UTC >> $GITHUB_ENV
echo LD_LIBRARY_PATH=`pwd`/lib >> $GITHUB_ENV
- name: Before install
working-directory: ${{ env.WXWIDGETS_ROOT }}
run: |
./build/tools/before_install.sh
- name: Install SWIG
run: |
brew install swig
- name: Install doxygen 1.9.6
run: |
brew tap mcorino/wxruby3
brew install doxygen@1.9.6
- name: Show build environment
run: |
echo "Environment:"
env | sort
echo
echo "Ruby version:"
ruby -v
echo
echo "SWIG version:"
swig -version
echo
echo "Doxygen version:"
doxygen -v
echo
echo "Compiler version:"
${CXX-g++} --version
echo
- name: Remove wxWidgets
run: |
rm -rf $WXWIDGETS_ROOT
- name: Install wxRuby3 gem
run: |
if [ "$WXRUBY_PRERELEASE" == "1" ]; then
gem install wxruby3 -v $WXRUBY_VERSION --pre -- WITH_WXWIN=1
else
gem install wxruby3 -v $WXRUBY_VERSION -- WITH_WXWIN=1
fi
- name: Run wxRuby3 regression tests
run: |
wxruby test
release-bingem:
needs: release
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} wxRuby Bingem Release (${{ github.ref_name }})
env:
DOXYGEN_ROOT: ${{ github.workspace }}\doxygen
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
platform: 'x64'
CXX: g++-12
ruby: '3.2'
wxWidgets: '3.2.4'
swig: '4'
steps:
- name: Checkout wxRuby3
uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Setup Ruby gems
if: ${{ github.event_name != 'workflow_dispatch' }}
run: |
bundle install
- name: Cache Doxygen
id: cache-doxygen
uses: actions/cache@v3
with:
path: doxygen-1.9.6.windows.x64.bin.zip
key: ${{ runner.os }}-doxygen
- name: Download Doxygen tool
run: |
wget.exe https://www.doxygen.nl/files/doxygen-1.9.6.windows.x64.bin.zip
$hash = 'bdf1af97a733edd0a60fce2cf375c5c3'
if ((Get-FileHash doxygen-1.9.6.windows.x64.bin.zip -Algorithm MD5).Hash -ne $hash) {
del doxygen-1.9.6.windows.x64.bin.zip
throw "Doxygen Hash doesn't match!"
}
- name: Install Doxygen package
if: ${{ github.event_name != 'workflow_dispatch' }}
run: |
Expand-Archive -LiteralPath '.\doxygen-1.9.6.windows.x64.bin.zip' -DestinationPath $env:DOXYGEN_ROOT -Force
echo "$env:DOXYGEN_ROOT" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Display build environment
if: ${{ github.event_name != 'workflow_dispatch' }}
run: |
echo "$env:PATH"
ruby -v
doxygen -v
ridk exec bash -c 'gcc -v'
ridk exec bash -c 'g++ -v'
- name: Configure wxRuby3
if: ${{ github.event_name != 'workflow_dispatch' }}
run: |
bundle exec rake configure[--with-wxwin]
- name: Build wxRuby3
if: ${{ github.event_name != 'workflow_dispatch' }}
run: |
bundle exec rake build
- name: Build wxRuby3 gem
if: ${{ github.event_name != 'workflow_dispatch' }}
run: |
bundle exec rake bingem
- name: Publish Gem on RubyGems
if: ${{ github.event_name != 'workflow_dispatch' }}
run: |
gem push pkg/*.gem
verify-bingem:
needs: [release, release-bingem]
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} wxRuby Bingem Test (${{ github.ref_name }})
env:
WXRUBY_VERSION: ${{ needs.release.outputs.version }}
WXRUBY_PRERELEASE: ${{ needs.release.outputs.prerelease }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
platform: 'x64'
CXX: g++-12
ruby: '3.2'
wxWidgets: '3.2.4'
swig: '4'
steps:
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Wait for RubyGems
run: |
Start-Sleep -Seconds 300
- name: Install wxRuby3 gem
if: matrix.wxr_type != 'develop'
run: |
If ("$env:WXRUBY_PRERELEASE" -eq "1") {
gem install wxruby3 -v $env:WXRUBY_VERSION --pre
}
Else {
gem install wxruby3 -v $env:WXRUBY_VERSION
}
- name: Run wxRuby3 regression tests
run: |
wxruby test