wxWidgets/.github/workflows/ci.yml

288 lines
9.7 KiB
YAML
Raw Normal View History

# Continuous integration workflow for wxWidgets.
name: GitHub CI
on:
push:
branches:
- master
paths-ignore:
- '.github/workflows/ci_msw_cross.yml'
- 'build/tools/appveyor*.bat'
- 'build/tools/travis-ci.sh'
- 'distrib/**'
- 'docs/**'
- 'interface/**'
- 'include/msvc/**'
- 'include/wx/msw/**'
- 'locale/**'
- 'src/msw/**'
- '*.md'
- '*.yml'
- 'wxwidgets.props'
pull_request:
branches:
- master
paths-ignore:
- '.github/workflows/ci_msw_cross.yml'
- 'build/tools/appveyor*.bat'
- 'build/tools/travis-ci.sh'
- 'distrib/**'
- 'docs/**'
- 'interface/**'
- 'include/msvc/**'
- 'include/wx/msw/**'
- 'locale/**'
- 'src/msw/**'
- '*.md'
- '*.yml'
- 'wxwidgets.props'
jobs:
build:
runs-on: ${{ matrix.runner }}
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu 16.04 wxGTK 2
runner: ubuntu-16.04
gtk_version: 2
use_xvfb: true
- name: Ubuntu 16.04 wxGTK 3 static
runner: ubuntu-16.04
configure_flags: --disable-shared
use_xvfb: true
- name: Ubuntu 18.04 wxGTK 2 UTF-8
runner: ubuntu-18.04
gtk_version: 2
configure_flags: --enable-utf8 --enable-utf8only --enable-monolithic
use_xvfb: true
- name: Ubuntu 18.04 wxGTK 3 STL
runner: ubuntu-18.04
configure_flags: --enable-cxx11 --enable-stl --disable-compat30
use_xvfb: true
- name: Ubuntu 18.04 wxGTK 3 with clang
runner: ubuntu-18.04
compiler: clang
configure_flags: --disable-sys-libs
use_xvfb: true
- name: Ubuntu 20.04 wxGTK ANSI
runner: ubuntu-20.04
configure_flags: --disable-unicode
skip_samples: true
- name: Ubuntu 20.04 wxGTK with ASAN
runner: ubuntu-20.04
configure_flags: --disable-compat30 --disable-sys-libs --disable-webview
skip_samples: true
use_asan: true
use_xvfb: true
- name: Ubuntu 18.04 wxX11
runner: ubuntu-18.04
configure_flags: --with-x11 --enable-pch --disable-stc
skip_samples: true
- name: Ubuntu 18.04 wxDFB
runner: ubuntu-18.04
configure_flags: --with-directfb --enable-pch --disable-stc
skip_samples: true
allow_warnings: true
- name: Ubuntu 18.04 wxMotif
runner: ubuntu-18.04
configure_flags: --with-motif --enable-pch --disable-stc
skip_samples: true
- name: Ubuntu 18.04 wxQt
runner: ubuntu-18.04
configure_flags: --with-qt --enable-pch --without-opengl
skip_samples: true
- name: macOS 10.15 wxMac
runner: macos-10.15
configure_flags: --disable-sys-libs
- name: macOS 10.15 wxiOS
runner: macos-10.15
configure_flags: --with-osx_iphone --enable-monolithic --disable-sys-libs --host=i686-apple-darwin_sim --build=x86_64-apple-darwin17.7.0
xcode_sdk: iphonesimulator
skip_samples: true
skip_testing: true
allow_warnings: true
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 }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Set environment variables
run: |
echo LD_LIBRARY_PATH=`pwd`/lib >> $GITHUB_ENV
case `uname` in
Linux)
wxPROC_COUNT=`nproc`
;;
Darwin)
wxPROC_COUNT=`sysctl -n hw.ncpu`
;;
*)
echo "*** Unknown platform: `uname` ***"
wxPROC_COUNT=0
;;
esac
((wxPROC_COUNT++))
echo wxPROC_COUNT=$wxPROC_COUNT >> $GITHUB_ENV
echo wxBUILD_ARGS=-j$wxPROC_COUNT >> $GITHUB_ENV
# Setting this variable suppresses "Error retrieving accessibility bus address"
# messages from WebKit tests that we're not interested in.
echo NO_AT_BRIDGE=1 >> $GITHUB_ENV
case "${{ matrix.compiler }}" in
clang)
echo CC=clang >> $GITHUB_ENV
echo CXX='clang++ -stdlib=libc++' >> $GITHUB_ENV
echo LD=clang++ >> $GITHUB_ENV
allow_warn_opt="-Wno-error=#warnings"
;;
'')
# Assume gcc.
allow_warn_opt="-Wno-error=cpp"
;;
*)
echo "*** Unknown compiler: ${{ matrix.compiler }} ***"
;;
esac
if [ -z ${{ matrix.allow_warnings }} ]; then
error_opts="-Werror $allow_warn_opt"
echo "wxMAKEFILE_ERROR_CXXFLAGS=$error_opts" >> $GITHUB_ENV
echo "wxMAKEFILE_CXXFLAGS=$wxMAKEFILE_CXXFLAGS $error_opts" >> $GITHUB_ENV
fi
echo "wxMAKEFILE_CXXFLAGS=$wxMAKEFILE_CXXFLAGS $error_opts" >> $GITHUB_ENV
- name: Before install
run: |
./build/tools/before_install.sh
- name: Configuring
run: |
wxCONFIGURE_OPTIONS="--disable-optimise $wxCONFIGURE_FLAGS"
if [ -n "${{ matrix.gtk_version }}" ]; then
wxCONFIGURE_OPTIONS="--with-gtk=${{ matrix.gtk_version }} $wxCONFIGURE_OPTIONS"
fi
if [ -n "${{ matrix.xcode_sdk }}" ]; then
sdk_path=`xcrun --sdk ${{ matrix.xcode_sdk }} --show-sdk-path`
wxCONFIGURE_OPTIONS="--with-macosx-sdk=$sdk_path $wxCONFIGURE_OPTIONS"
fi
if [ ${{ matrix.use_asan }} ]; then
wxASAN_CFLAGS="-fsanitize=address -fno-omit-frame-pointer"
wxASAN_CXXFLAGS=$wxASAN_CFLAGS
wxASAN_LDFLAGS="-fsanitize=address"
./configure $wxCONFIGURE_OPTIONS --enable-debug "CFLAGS=$wxASAN_CFLAGS" "CXXFLAGS=$wxASAN_CXXFLAGS" "LDFLAGS=$wxASAN_LDFLAGS" || rc=$?
else
./configure $wxCONFIGURE_OPTIONS --disable-debug_info || rc=$?
fi
if [ -n "$rc" ]; then
echo '*** Configuring failed, contents of config.log follows: ***'
echo '-----------------------------------------------------------'
cat config.log
echo '-----------------------------------------------------------'
exit $rc
fi
- name: Building
run: |
make -k $wxBUILD_ARGS "CXXFLAGS=$wxMAKEFILE_ERROR_CXXFLAGS"
- name: Building tests
if: matrix.skip_testing != true
working-directory: tests
run: |
if [ !${{ matrix.skip_gui }} ]; then
make $wxBUILD_ARGS failtest
fi
make -k $wxBUILD_ARGS "CXXFLAGS=$wxMAKEFILE_CXXFLAGS" "LDFLAGS=$wxMAKEFILE_LDFLAGS"
- name: Testing
if: matrix.skip_testing != true
working-directory: tests
run: |
. ../build/tools/httpbin.sh
httpbin_launch
export ASAN_OPTIONS=fast_unwind_on_malloc=0
# Explicitly use bash because /bin/sh doesn't have pipefail option
/bin/bash -o pipefail -c './test 2>&1 | tee test.out' || rc=$?
if [ ${{ matrix.use_asan }} ]; then
# Work around spurious crashes by running the test again.
# See https://github.com/google/sanitizers/issues/1353
if fgrep -q 'LeakSanitizer has encountered a fatal error' test.out; then
echo '+++ Rerunning the tests once again after LeakSanitizer crash +++'
unset rc
./test || rc=$?
fi
fi
if [ -n "$rc" ]; then
httpbin_show_log
exit $rc
fi
- name: Testing GUI using Xvfb
if: matrix.skip_testing != true && matrix.skip_gui != true && matrix.use_xvfb
working-directory: tests
run: |
if [ ${{ matrix.use_asan }} ]; then
# Leak suppression only works if we have debug symbols available,
# otherwise we disable it to avoid tons of reports about leaks in
# libfontconfig etc.
if [ -f wx_dbgsym_available ]; then
export LSAN_OPTIONS=suppressions=$(pwd)/misc/suppressions/lsan
else
ASAN_OPTIONS=detect_leaks=0
fi
export ASAN_OPTIONS="$ASAN_OPTIONS fast_unwind_on_malloc=0"
fi
ulimit -c unlimited
/bin/bash -o pipefail -c 'xvfb-run -a -s "-screen 0 1600x1200x24" ./test_gui 2>&1 | tee test_gui.out' || rc=$?
if [ -n "$rc" ]; then
if fgrep -q '(core dumped)' test_gui.out; then
echo '*** Test crashed, trying to get more information ***'
gdb --quiet --core=core -ex 'where' -ex 'thread apply all bt' -ex 'q' ./test_gui
fi
exit $rc
fi
- name: Building samples
if: matrix.skip_testing != true && matrix.skip_gui != true && matrix.skip_samples != true
run: |
make -k $wxBUILD_ARGS "CXXFLAGS=$wxMAKEFILE_CXXFLAGS" "LDFLAGS=$wxMAKEFILE_LDFLAGS" samples
- name: Installing
if: matrix.skip_testing != true
run: |
sudo make install
- name: Testing installation
if: matrix.skip_testing != true
run: |
make -C samples/minimal -f makefile.unx clean
make -C samples/minimal -f makefile.unx $wxBUILD_ARGS "CXXFLAGS=$wxMAKEFILE_CXXFLAGS" "LDFLAGS=$wxMAKEFILE_LDFLAGS"