-
Notifications
You must be signed in to change notification settings - Fork 7
202 lines (183 loc) · 6.73 KB
/
linux-master.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
name: Linux wxGTK master builds
on:
schedule:
- cron: '0 5 * * 5'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
WXWIDGETS_ROOT: ${{ github.workspace }}/ext/wxWidgets
WXWIN_INSTALL: ${{ github.workspace }}/ext/wxWidgets/install
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
gtk_version: 3
CC: gcc-12
CXX: g++-12
ruby: '3.2'
wxWidgets: 'master'
swig: '4'
configure_flags:
use_xvfb: true
wxw_type: develop
wxr_type: develop
- os: ubuntu-22.04
gtk_version: 3
CC: gcc-12
CXX: g++-12
ruby: '3.2'
wxWidgets: 'master'
swig: '4'
configure_flags:
use_xvfb: true
wxw_type: develop
wxr_type: gem
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} wxRuby(${{ matrix.wxr_type }}) ${{ matrix.CXX }} ruby-${{ matrix.ruby }} wxWidgets-${{ matrix.wxWidgets }}(${{ matrix.wxw_type }}) SWIG${{ matrix.swig }}
env:
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 }}
steps:
- name: Checkout wxRuby3
uses: actions/checkout@v4
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Setup Ruby gems
run: |
bundle install
- name: checkout wxWidgets
uses: actions/checkout@v4
with:
repository: wxWidgets/wxWidgets
path: ${{ env.WXWIDGETS_ROOT }}
ref: ${{ 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
if: matrix.wxw_type != 'embed'
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
if [ "${{ matrix.wxw_type }}" == "develop" ]; then
./configure $wxCONFIGURE_OPTIONS --prefix=$WXWIN_INSTALL --disable-tests --without-subdirs --disable-debug_info || rc=$?
else
./configure $wxCONFIGURE_OPTIONS --disable-tests --without-subdirs --disable-debug_info || rc=$?
fi
if [ -n "$rc" ]; then
echo '*** Configuring failed, contents of config.log follows: ***'
echo '-----------------------------------------------------------'
cat $WXWIDGETS_ROOT/config.log
echo '-----------------------------------------------------------'
exit $rc
fi
- name: Build wxWidgets
if: matrix.wxw_type != 'embed'
working-directory: ${{ env.WXWIDGETS_ROOT }}
run: |
if [ "${{ matrix.wxw_type }}" == "develop" ]; then
WX_SKIP_DOXYGEN_VERSION_CHECK=1
make && make install && pushd docs/doxygen && ./regen.sh xml && popd
else
make && sudo make install && sudo ldconfig
fi
- name: Remove wxWidgets
if: matrix.wxw_type != 'develop'
run: rm -rf $WXWIDGETS_ROOT
- name: Configure wxRuby3
if: matrix.wxr_type != 'gem'
run: |
if [ "${{ matrix.wxw_type }}" == "embed" ]; then
bundle exec rake configure[--with-wxwin]
elif [ "${{ matrix.wxw_type }}" == "develop" ]; then
bundle exec rake configure[--wxwin=$WXWIN_INSTALL,--wxxml=$WXWIDGETS_ROOT/docs/doxygen/out/xml]
else
bundle exec rake configure
fi
- name: Build wxRuby3
if: matrix.wxr_type != 'gem'
run: |
bundle exec rake build
- name: Build wxRuby3 gem
if: matrix.wxr_type == 'gem' || matrix.wxr_type == 'bingem'
run: |
if [ "${{ matrix.wxr_type }}" == "gem" ]; then
bundle exec rake gem
else
BUILD_CMD="bundle exec rake bingem"
/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
fi
- name: Install wxRuby3 gem
if: matrix.wxr_type != 'develop'
run: |
if [ "${{ matrix.wxr_type }}" == "bingem" ]; then
gem install $(echo pkg/*.gem)
else
if [ "${{ matrix.wxw_type }}" == "system" ]; then
BUILD_CMD="gem install $(echo pkg/*.gem)"
else
BUILD_CMD="gem install $(echo pkg/*.gem) -- WXWIN=$WXWIN_INSTALL WXXML=$WXWIDGETS_ROOT/docs/doxygen/out/xml"
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
fi
- name: Run wxRuby3 regression tests
run: |
ulimit -c unlimited
if [ "${{ matrix.wxr_type }}" == "develop" ]; then
TEST_CMD="bundle exec rake test"
else
if [ "${{ matrix.wxw_type }}" == "develop" ]; then
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$WXWIN_INSTALL/lib
fi
TEST_CMD="wxruby test"
fi
/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