Skip to content

Merge pull request #267 from mcorino/develop #567

Merge pull request #267 from mcorino/develop

Merge pull request #267 from mcorino/develop #567

Workflow file for this run

name: Linux wxGTK builds
on:
push:
branches:
- master
tags:
- v*
paths-ignore:
- '.github/**'
- 'assets/**'
- 'tools/**'
- 'lib/wx/doc/**'
- 'lib/wx/version.rb'
- '**.md'
- '.cirrus.yml'
pull_request:
branches:
- master
paths-ignore:
- '.github/**'
- 'assets/**'
- 'tools/**'
- 'lib/wx/doc/**'
- 'lib/wx/version.rb'
- 'rakelib/lib/**/*.yaml'
- '**.md'
- 'Gemfile'
- '.yardopts'
- '.gitignore'
- 'LICENSE'
- '.cirrus.yml'
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
WXWIDGETS_LATEST_STABLE: 3.2.4
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
gtk_version: 3
CC: gcc-9
CXX: g++-9
ruby: '2.5'
wxWidgets: '3.2.4'
swig: '4'
configure_flags:
use_xvfb: true
wxw_type: system
wxr_type: develop
- os: ubuntu-20.04
gtk_version: 3
CC: gcc-10
CXX: g++-10
ruby: 'ruby'
wxWidgets: '3.2.4'
swig: '4'
configure_flags:
use_xvfb: true
wxw_type: develop
wxr_type: develop
- os: ubuntu-20.04
gtk_version: 3
CC: gcc-9
CXX: g++-9
ruby: '2.5'
wxWidgets: '3.2.4'
swig: '4'
configure_flags:
use_xvfb: true
wxw_type: develop
wxr_type: gem
- os: ubuntu-22.04
gtk_version: 3
CC: gcc-11
CXX: g++-11
ruby: '3.0'
wxWidgets: '3.2.4'
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: 'ruby'
wxWidgets: '3.2.4'
swig: '4'
configure_flags:
use_xvfb: true
wxw_type: system
wxr_type: develop
- 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
wxw_type: system
wxr_type: gem
- os: ubuntu-22.04
gtk_version: 3
CC: gcc-12
CXX: g++-12
ruby: 'ruby'
wxWidgets: '3.2.4'
swig: '4'
configure_flags:
use_xvfb: true
wxw_type: embed
wxr_type: gem
- os: ubuntu-22.04
gtk_version: 3
CC: gcc-12
CXX: g++-12
ruby: 'ruby'
wxWidgets: '3.2.4'
swig: '4'
configure_flags:
use_xvfb: true
wxw_type: embed
wxr_type: binpkg
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
if: matrix.wxw_type != 'embed'
uses: actions/checkout@v4
with:
repository: wxWidgets/wxWidgets
path: ${{ env.WXWIDGETS_ROOT }}
ref: v${{ matrix.wxWidgets }}
submodules: 'recursive'
- name: Set up build environment
if: matrix.wxw_type != 'embed'
run: |
$WXWIDGETS_ROOT/build/tools/before_install.sh
- name: Show build environment
run: |
echo "Environment:"
env | sort
echo
echo "Ruby version:"
ruby -v
echo
echo "SWIG version:"
swig -version
echo
if [ "${{ matrix.wxw_type }}" != "embed" ]; then
echo "Doxygen version:"
doxygen -v
echo
fi
echo "Compiler version:"
${CXX-g++} --version
echo
- 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
export WX_SKIP_DOXYGEN_VERSION_CHECK=1
make -j$(nproc) && make install && pushd docs/doxygen && ./regen.sh xml && popd
else
make -j$(nproc) && sudo make install && sudo ldconfig
fi
- name: Remove wxWidgets
if: matrix.wxw_type == 'system'
run: rm -rf $WXWIDGETS_ROOT
- name: Configure wxRuby3
if: matrix.wxr_type != 'gem'
run: |
if [ "${{ matrix.wxw_type }}" == "embed" ]; then
bundle exec rake configure[--autoinstall]
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: Run wxRuby3 post-build checks
if: matrix.wxr_type != 'gem'
run: |
ruby tools/check_swig_types.rb
- name: Build wxRuby3 gem
if: matrix.wxr_type == 'gem' || matrix.wxr_type == 'binpkg'
run: |
bundle exec rake gem
if [ "${{ matrix.wxr_type }}" == "binpkg" ]; then
bundle exec rake binpkg
fi
- name: Install wxRuby3 gem
if: matrix.wxr_type != 'develop'
run: |
if [ "${{ matrix.wxr_type }}" == "binpkg" ]; then
gem install $(echo pkg/*.gem) -- package=`pwd`/$(echo pkg/*.pkg)
else
if [ "${{ matrix.wxw_type }}" == "system" ]; then
gem install $(echo pkg/*.gem) -- prebuilt=none && wxruby setup -- --wxwin=@system
elif [ "${{ matrix.wxw_type }}" == "embed" ]; then
gem install $(echo pkg/*.gem) -- prebuilt=none && wxruby setup --autoinstall
else
gem install $(echo pkg/*.gem) -- prebuilt=none && wxruby setup --wxwin=$WXWIN_INSTALL
fi
fi
- name: Check wxRuby3 gem install
if: matrix.wxr_type != 'develop'
run: |
if [ "${{ matrix.wxw_type }}" == "develop" ]; then
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$WXWIN_INSTALL/lib
fi
wxruby check
- name: Check embedded wxWidgets version
if: matrix.wxw_type == 'embed'
run: |
if [ "${{ matrix.wxr_type }}" == "develop" ]; then
bundle exec rake wxruby:exec[ruby,tools/check_wxw_version.rb,$WXWIDGETS_LATEST_STABLE]
else
ruby tools/check_wxw_version.rb "$WXWIDGETS_LATEST_STABLE"
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