Files
wxWidgets/.github/workflows/ci_mac_selfhosted.yml
Vadim Zeitlin 0701402737 Add CI workflow for building wxMSW using MSVS natively
This should allow running all the tests faster than it's done by
AppVeyor.

Ignore changes to this workflow file in all the other workflows.
2021-08-24 17:12:06 +02:00

198 lines
6.2 KiB
YAML

name: Mac builds
on:
workflow_dispatch:
push:
branches: [ master ]
paths-ignore:
- '.github/workflows/ci.yml'
- '.github/workflows/ci_cmake.yml'
- '.github/workflows/ci_msw.yml'
- '.github/workflows/ci_msw_cross.yml'
- 'build/tools/appveyor*.bat'
- 'distrib/**'
- 'docs/**'
- 'interface/**'
- 'include/msvc/**'
- 'include/wx/dfb/**'
- 'include/wx/gtk/**'
- 'include/wx/gtk1/**'
- 'include/wx/motif/**'
- 'include/wx/msw/**'
- 'include/wx/x11/**'
- 'locale/**'
- 'src/dfb/**'
- 'src/gtk/**'
- 'src/gtk1/**'
- 'src/motif/**'
- 'src/msw/**'
- 'src/x11/**'
- '*.md'
- '*.yml'
- 'wxwidgets.props'
pull_request:
branches: [ master ]
paths-ignore:
- '.github/workflows/ci.yml'
- '.github/workflows/ci_cmake.yml'
- '.github/workflows/ci_msw.yml'
- '.github/workflows/ci_msw_cross.yml'
- 'build/tools/appveyor*.bat'
- 'distrib/**'
- 'docs/**'
- 'interface/**'
- 'include/msvc/**'
- 'include/wx/dfb/**'
- 'include/wx/gtk/**'
- 'include/wx/gtk1/**'
- 'include/wx/motif/**'
- 'include/wx/msw/**'
- 'include/wx/x11/**'
- 'locale/**'
- 'src/dfb/**'
- 'src/gtk/**'
- 'src/gtk1/**'
- 'src/motif/**'
- 'src/msw/**'
- 'src/x11/**'
- '*.md'
- '*.yml'
- 'wxwidgets.props'
jobs:
build-and-test:
defaults:
run:
shell: /usr/bin/arch -arch ${{ matrix.arch }} /bin/bash -l {0}
runs-on: self-hosted
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: ARM C++11
arch: arm64
configure_flags: --with-cxx=11
use_asan: true
- name: Intel C++17
arch: x86_64
configure_flags: --with-cxx=17 --with-macosx-version-min=10.12 --enable-debug
- name: Universal C++14
arch: arm64
configure_flags: --with-cxx=14 --enable-universal_binary=arm64,x86_64 --disable-shared --disable-debug --enable-optimise
env:
wxCONFIGURE_FLAGS: --disable-sys-libs --without-liblzma ${{ matrix.configure_flags }} --prefix=${{ github.workspace }}/localbin_${{ matrix.arch }}
wxUSE_ASAN: ${{ matrix.use_asan && 1 || 0 }}
DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer
NSUnbufferedIO: YES
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Set environment variables
run: |
echo TZ=UTC >> $GITHUB_ENV
echo LD_LIBRARY_PATH=`pwd`/lib >> $GITHUB_ENV
wxPROC_COUNT=`sysctl -n hw.logicalcpu`
((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
mkdir -p $PWD/localbin_${{ matrix.arch }}
- name: Configuring
run: |
wxCONFIGURE_OPTIONS="--disable-optimise $wxCONFIGURE_FLAGS"
./configure $wxCONFIGURE_OPTIONS --disable-debug_info || rc=$?
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
run: |
if [ !${{ matrix.skip_gui }} ]; then
make -C tests $wxBUILD_ARGS failtest
fi
make -k -C tests $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 [ -n "$rc" ]; then
httpbin_show_log
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: |
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 WX_CONFIG=${{ github.workspace }}/localbin_${{ matrix.arch }}/bin/wx-config $wxBUILD_ARGS "CXXFLAGS=$wxMAKEFILE_CXXFLAGS" "LDFLAGS=$wxMAKEFILE_LDFLAGS"