Expand self-hosted Mac M1 CI build workflow

See https://github.com/wxWidgets/wxWidgets/pull/2336
This commit is contained in:
Stefan Csomor 2021-08-20 17:05:38 +02:00 committed by Vadim Zeitlin
parent 6d00ab47db
commit b3b24e962e
2 changed files with 164 additions and 20 deletions

View File

@ -2,39 +2,181 @@ name: Mac make CI
on: on:
workflow_dispatch: workflow_dispatch:
# push: push:
# branches: [ master ] branches: [ master ]
# pull_request: paths-ignore:
# branches: [ master ] - 'build/tools/appveyor*.bat'
- 'build/tools/travis-ci.sh'
- '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:
- 'build/tools/appveyor*.bat'
- 'build/tools/travis-ci.sh'
- '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: jobs:
build-and-test: build-and-test:
defaults: defaults:
run: run:
shell: /usr/bin/arch -arch ${{ matrix.arch }} /bin/bash -l {0} shell: /usr/bin/arch -arch ${{ matrix.arch }} /bin/bash -l {0}
runs-on: self-hosted runs-on: self-hosted
env: name: ${{ matrix.build }}, arch ${{ matrix.arch }}, cxx${{ matrix.cxx }}
DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer
NSUnbufferedIO: YES
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
arch: [arm64e, x86_64] arch: [arm64e, x86_64]
build: [debug, release]
cxx: [11, 17]
include:
- build: debug
configure_flags: --without-liblzma --enable-debug --disable-sys-libs --with-osx_cocoa
- build: release
configure_flags: --without-liblzma --disable-sys-libs --with-osx_cocoa
- cxx: 17
cxxconfig: --with-macosx-version-min=10.12
- cxx: 11
cxxconfig:
env:
wxCONFIGURE_FLAGS: ${{ matrix.configure_flags }} ${{ matrix.cxxconfig }} --with-cxx=${{ matrix.cxx }} --prefix=${{ github.workspace }}/localbin_${{ matrix.arch }}
DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer
NSUnbufferedIO: YES
steps: steps:
- uses: actions/checkout@v2 - name: Checkout
uses: actions/checkout@v2
with: with:
submodules: recursive submodules: recursive
- name: configure
run: mkdir -p $PWD/localbin_${{ matrix.arch }}; ./configure --prefix=$PWD/localbin_${{ matrix.arch }} - name: Set environment variables
- name: make run: |
run: make -j4 echo TZ=UTC >> $GITHUB_ENV
- name: make install echo LD_LIBRARY_PATH=`pwd`/lib >> $GITHUB_ENV
run: make install wxPROC_COUNT=`sysctl -n hw.logicalcpu`
- name: make tests ((wxPROC_COUNT++))
run: make -j4 -C tests echo wxPROC_COUNT=$wxPROC_COUNT >> $GITHUB_ENV
- name: run tests echo wxBUILD_ARGS=-j$wxPROC_COUNT >> $GITHUB_ENV
run: pushd tests;./test;popd # 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 [ -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"

View File

@ -6,6 +6,7 @@ on:
branches: branches:
- master - master
paths-ignore: paths-ignore:
- '.github/workflows/MacS-M1-make.yml'
- '.github/workflows/ci_cmake.yml' - '.github/workflows/ci_cmake.yml'
- '.github/workflows/ci_msw_cross.yml' - '.github/workflows/ci_msw_cross.yml'
- 'build/tools/appveyor*.bat' - 'build/tools/appveyor*.bat'
@ -23,6 +24,7 @@ on:
branches: branches:
- master - master
paths-ignore: paths-ignore:
- '.github/workflows/MacS-M1-make.yml'
- '.github/workflows/ci_cmake.yml' - '.github/workflows/ci_cmake.yml'
- '.github/workflows/ci_msw_cross.yml' - '.github/workflows/ci_msw_cross.yml'
- 'build/tools/appveyor*.bat' - 'build/tools/appveyor*.bat'