2021-06-27 07:16:08 -04:00
|
|
|
# CI workflow cross-building wxMSW under Linux.
|
2021-08-21 09:43:44 -04:00
|
|
|
name: MSW cross-builds
|
2021-06-27 07:16:08 -04:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
paths-ignore:
|
|
|
|
- '.github/workflows/ci.yml'
|
2021-08-21 08:39:43 -04:00
|
|
|
- '.github/workflows/ci_cmake.yml'
|
2021-08-28 17:30:35 -04:00
|
|
|
- '.github/workflows/ci_mac.yml'
|
2021-08-24 09:53:40 -04:00
|
|
|
- '.github/workflows/ci_msw.yml'
|
2021-06-27 07:16:08 -04:00
|
|
|
- 'build/tools/appveyor*.bat'
|
|
|
|
- 'distrib/**'
|
|
|
|
- 'docs/**'
|
|
|
|
- 'interface/**'
|
|
|
|
- 'include/msvc/**'
|
|
|
|
- 'include/wx/gtk/**'
|
|
|
|
- 'include/wx/osx/**'
|
|
|
|
- 'locale/**'
|
2021-08-24 09:36:31 -04:00
|
|
|
- 'src/gtk/**'
|
2021-06-27 07:16:08 -04:00
|
|
|
- 'src/osx/**'
|
|
|
|
- '*.md'
|
|
|
|
- '*.yml'
|
|
|
|
- 'wxwidgets.props'
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
paths-ignore:
|
|
|
|
- '.github/workflows/ci.yml'
|
2021-08-21 08:39:43 -04:00
|
|
|
- '.github/workflows/ci_cmake.yml'
|
2021-08-28 17:30:35 -04:00
|
|
|
- '.github/workflows/ci_mac.yml'
|
2021-08-24 09:53:40 -04:00
|
|
|
- '.github/workflows/ci_msw.yml'
|
2021-06-27 07:16:08 -04:00
|
|
|
- 'build/tools/appveyor*.bat'
|
|
|
|
- 'distrib/**'
|
|
|
|
- 'docs/**'
|
|
|
|
- 'interface/**'
|
|
|
|
- 'include/msvc/**'
|
|
|
|
- 'include/wx/gtk/**'
|
|
|
|
- 'include/wx/osx/**'
|
|
|
|
- 'locale/**'
|
2021-08-24 09:36:31 -04:00
|
|
|
- 'src/gtk/**'
|
2021-06-27 07:16:08 -04:00
|
|
|
- 'src/osx/**'
|
|
|
|
- '*.md'
|
|
|
|
- '*.yml'
|
|
|
|
- 'wxwidgets.props'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
msw-cross-build:
|
|
|
|
# Set up this job to run in a Debian Sid container because it has recent
|
|
|
|
# versions of MinGW and Wine and is simpler to test with locally than the
|
|
|
|
# bespoke container used by GitHub Actions by default.
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container: debian:sid-slim
|
|
|
|
name: ${{ matrix.name }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- name: wxMSW 64 bits
|
|
|
|
- name: wxMSW 32 bits
|
|
|
|
triplet: i686-w64-mingw32
|
|
|
|
env:
|
|
|
|
# Default to 64-bit build.
|
|
|
|
HOST_TRIPLET: ${{ matrix.triplet || 'x86_64-w64-mingw32' }}
|
|
|
|
|
2021-07-04 11:43:18 -04:00
|
|
|
# While our tests should run in any locale natively, it seems that Wine
|
|
|
|
# requires the locale encoding to be UTF-8 for Unicode file names to work
|
|
|
|
# correctly, so set the locale explicitly for it.
|
|
|
|
LC_ALL: C.UTF-8
|
|
|
|
|
2021-06-27 07:16:08 -04:00
|
|
|
# Run all commands as the normal user, created by the first step below.
|
|
|
|
#
|
|
|
|
# Note that the Bash options used here are the same as for the default
|
|
|
|
# shell used by GitHub Actions to minimize any surprises.
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: /usr/bin/setpriv --reuid=runner --regid=adm --clear-groups --inh-caps=-all bash --noprofile --norc -eo pipefail {0}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Set up container user
|
|
|
|
# Specify the default shell explicitly to override the default value above.
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
apt-get -q -o=Dpkg::Use-Pty=0 update
|
2021-08-27 17:29:41 -04:00
|
|
|
apt-get -q -o=Dpkg::Use-Pty=0 -y install sudo
|
2021-06-27 07:16:08 -04:00
|
|
|
|
|
|
|
# Create a user with the same UID/GID and name as the existing user
|
|
|
|
# outside of the container and allow it using sudo without password.
|
|
|
|
useradd --home-dir $HOME --no-create-home --gid adm --uid 1001 runner
|
|
|
|
|
|
|
|
echo 'runner ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/runner
|
|
|
|
|
|
|
|
- name: Install prerequisites
|
|
|
|
run: |
|
2021-07-03 10:11:19 -04:00
|
|
|
packages="git make wine x11-xserver-utils xvfb"
|
2021-06-27 07:16:08 -04:00
|
|
|
|
|
|
|
case "${HOST_TRIPLET}" in
|
|
|
|
x86_64-w64-mingw32)
|
|
|
|
packages="$packages g++-mingw-w64-x86-64 wine64"
|
2021-06-27 11:30:15 -04:00
|
|
|
winerun=wine64
|
2021-06-27 07:16:08 -04:00
|
|
|
;;
|
|
|
|
|
|
|
|
i686-w64-mingw32)
|
|
|
|
sudo dpkg --add-architecture i386
|
|
|
|
sudo apt-get -q -o=Dpkg::Use-Pty=0 update
|
2021-08-27 15:46:49 -04:00
|
|
|
packages="$packages g++-mingw-w64-i686 wine32 libgl1:i386"
|
2021-06-27 11:30:15 -04:00
|
|
|
winerun=wine
|
2021-06-27 07:16:08 -04:00
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
echo "Unknown host triplet \"${HOST_TRIPLET}\"."
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2021-08-27 17:29:41 -04:00
|
|
|
sudo DEBIAN_FRONTEND=noninteractive apt-get -q -o=Dpkg::Use-Pty=0 -y install $packages
|
2021-06-27 07:16:08 -04:00
|
|
|
|
2021-06-27 20:02:47 -04:00
|
|
|
echo "wxTEST_RUNNER=${winerun}" >> $GITHUB_ENV
|
2021-06-27 11:30:15 -04:00
|
|
|
|
2021-06-27 07:16:08 -04:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
submodules: 'recursive'
|
|
|
|
|
2021-06-27 07:42:00 -04:00
|
|
|
- name: System and environment setup
|
2021-06-27 07:16:08 -04:00
|
|
|
run: |
|
2021-06-27 07:42:00 -04:00
|
|
|
normal_uid=`id --user`
|
|
|
|
|
|
|
|
# The checkout actions runs as root and there doesn't seem to be any
|
|
|
|
# way to change this, so just adjust the owner after checkout.
|
|
|
|
sudo chown -R $normal_uid $GITHUB_WORKSPACE
|
|
|
|
|
2021-06-27 08:34:49 -04:00
|
|
|
# Add the directories containing MinGW and wx DLLs to Wine path.
|
2021-07-23 10:24:55 -04:00
|
|
|
winepath="$(winepath --windows $(dirname $(${HOST_TRIPLET}-g++ -print-libgcc-file-name)))"
|
2021-06-27 08:34:49 -04:00
|
|
|
winepath="${winepath};$(winepath --windows $(pwd)/lib)"
|
|
|
|
echo "WINEPATH=${winepath}" >> $GITHUB_ENV
|
2021-06-27 07:16:08 -04:00
|
|
|
|
|
|
|
cpu_count=`nproc`
|
|
|
|
((cpu_count++))
|
|
|
|
echo "wxMAKE_ARGS=-k -j$cpu_count" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
echo "wxMAKEFILE_ERROR_CXXFLAGS=-Werror -Wno-error=cpp" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Configure
|
|
|
|
run: |
|
|
|
|
./configure --host=${HOST_TRIPLET} --disable-sys-libs --disable-optimise --disable-debug_info || rc=$?
|
|
|
|
|
|
|
|
if [ -n "$rc" ]; then
|
|
|
|
echo '*** Configuring failed, contents of config.log follows: ***'
|
|
|
|
echo '-----------------------------------------------------------'
|
|
|
|
cat config.log
|
|
|
|
echo '-----------------------------------------------------------'
|
|
|
|
exit $rc
|
|
|
|
fi
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
make $wxMAKE_ARGS "CXXFLAGS=$wxMAKEFILE_ERROR_CXXFLAGS"
|
|
|
|
|
|
|
|
- name: Build samples
|
|
|
|
run: |
|
|
|
|
make $wxMAKE_ARGS "CXXFLAGS=$wxMAKEFILE_ERROR_CXXFLAGS" samples
|
|
|
|
|
|
|
|
- name: Build tests
|
|
|
|
working-directory: tests
|
|
|
|
run: |
|
|
|
|
make $wxMAKE_ARGS failtest
|
|
|
|
make $wxMAKE_ARGS "CXXFLAGS=$wxMAKEFILE_ERROR_CXXFLAGS"
|
|
|
|
|
2021-06-27 13:46:29 -04:00
|
|
|
- name: Launch Xvfb
|
2021-06-27 07:16:08 -04:00
|
|
|
run: |
|
|
|
|
echo 'Launching Xvfb...'
|
|
|
|
sudo mkdir /tmp/.X11-unix
|
|
|
|
sudo chmod 1777 /tmp/.X11-unix
|
|
|
|
Xvfb :10 -screen 0 1600x1200x24 &
|
|
|
|
num_tries=1
|
|
|
|
while true; do
|
|
|
|
if xset -d :10 -q >/dev/null 2>&1; then
|
|
|
|
echo 'Xvfb has become available.'
|
|
|
|
# Trying to use it immediately can still result in errors
|
|
|
|
# when creating the windows, somehow, so give it some time
|
|
|
|
# to settle.
|
|
|
|
sleep 3
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ $num_tries -gt 10 ]]; then
|
|
|
|
echo 'Timed out waiting for Xvfb'
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
((num_tries++))
|
|
|
|
echo "Still waiting for Xvfb (attempt #$num_tries)"
|
|
|
|
sleep 3
|
|
|
|
done
|
2021-06-27 13:46:29 -04:00
|
|
|
echo 'Xvfb is running on display :10'
|
|
|
|
echo 'DISPLAY=:10' >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Run non-GUI tests
|
|
|
|
working-directory: tests
|
|
|
|
run: |
|
2021-06-27 20:18:17 -04:00
|
|
|
# Some tests are currently failing under Wine while they pass under
|
|
|
|
# native MSW, just skip running them until they can be dealt with.
|
|
|
|
|
|
|
|
# As soon as we specify the tests to exclude explicitly, we also need
|
|
|
|
# to exclude the tests that are not run by default, so start with this.
|
|
|
|
excluded_tests=('~[.]')
|
|
|
|
|
2021-07-04 09:11:04 -04:00
|
|
|
# There is 1 day difference in creation time under Wine somehow.
|
|
|
|
excluded_tests+=('~wxFileName::SetTimes')
|
2021-06-27 20:18:17 -04:00
|
|
|
|
2021-07-04 09:11:04 -04:00
|
|
|
# Closing the file fails for unknown reason under Wine.
|
|
|
|
excluded_tests+=('~FileFunctions::Error')
|
2021-06-27 20:18:17 -04:00
|
|
|
|
|
|
|
# Sporadic failures due to extra events.
|
|
|
|
excluded_tests+=('~wxFileSystemWatcher::EventCreate')
|
|
|
|
|
|
|
|
# The test fails (even with wxTEST_RUNNER-related changes) and hangs.
|
|
|
|
excluded_tests+=('~ExecTestCase')
|
|
|
|
|
|
|
|
# Wine WinHTTP implementations seems buggy, there are many errors.
|
|
|
|
excluded_tests+=('~[webrequest]')
|
|
|
|
|
2021-07-03 10:11:19 -04:00
|
|
|
$wxTEST_RUNNER ./test "${excluded_tests[@]}"
|
2021-06-27 13:46:29 -04:00
|
|
|
|
|
|
|
- name: Run GUI tests
|
|
|
|
working-directory: tests
|
|
|
|
run: |
|
2021-06-27 20:18:17 -04:00
|
|
|
# Same as for the non-GUI test above, except many more GUI tests fail
|
|
|
|
# under Wine.
|
|
|
|
excluded_gui_tests=('~[.]')
|
|
|
|
|
|
|
|
excluded_gui_tests+=('~BitmapComboBoxTestCase') # TextChangeEvents
|
|
|
|
excluded_gui_tests+=('~ClippingBoxTestCase*')
|
|
|
|
excluded_gui_tests+=('~ComboBoxTestCase') # TextChangeEvents
|
|
|
|
excluded_gui_tests+=('~DatePickerCtrlTestCase') # Range
|
|
|
|
excluded_gui_tests+=('~wxDC::GetTextExtent')
|
|
|
|
excluded_gui_tests+=('~ExecTestCase')
|
|
|
|
excluded_gui_tests+=('~wxFont::GetSet')
|
|
|
|
excluded_gui_tests+=('~GraphicsPathTestCaseGDIPlus')
|
|
|
|
excluded_gui_tests+=('~ImageList*')
|
|
|
|
excluded_gui_tests+=('~RadioButton::Focus')
|
|
|
|
excluded_gui_tests+=('~SettingsTestCase') # GetFont fails
|
|
|
|
excluded_gui_tests+=('~SliderTestCase') # Thumb
|
|
|
|
excluded_gui_tests+=('~TransformMatrixTestCase*')
|
|
|
|
excluded_gui_tests+=('~TreeCtrlTestCase') # LabelEdit
|
|
|
|
excluded_gui_tests+=('~TextCtrlTestCase') # many sub-tests
|
|
|
|
excluded_gui_tests+=('~wxTextCtrl::InitialCanUndo')
|
|
|
|
excluded_gui_tests+=('~[wxWebView]')
|
|
|
|
excluded_gui_tests+=('~Window::PositioningBeyondShortLimit')
|
|
|
|
excluded_gui_tests+=('~XRC::LoadURL')
|
|
|
|
|
|
|
|
$wxTEST_RUNNER ./test_gui "${excluded_gui_tests[@]}"
|