Files
wxWidgets/.github/workflows/ci_cmake.yml
T
Vadim Zeitlin e854a2e0dc Switch macOS 14 CI jobs to macOS 15
macOS 14 runners will be retired by GitHub soon.
2026-10-04 15:01:57 +02:00

272 lines
9.0 KiB
YAML

# CI workflow for wxWidgets builds using CMake.
name: CMake builds
on:
push:
branches:
- master
paths-ignore:
- '.circleci/**'
- '.github/ISSUE_TEMPLATE/**'
- '.github/workflows/ci.yml'
- '.github/workflows/ci_mac.yml'
- '.github/workflows/ci_msw.yml'
- '.github/workflows/ci_msw_cross.yml'
- '.github/workflows/docs_update.yml'
- 'build/tools/appveyor*.bat'
- 'distrib/**'
- 'docs/**'
- 'interface/**'
- 'locale/**'
- '*.md'
- '*.yml'
- 'wxwidgets.props'
pull_request:
branches:
- master
paths-ignore:
- '.circleci/**'
- '.github/ISSUE_TEMPLATE/**'
- '.github/workflows/ci.yml'
- '.github/workflows/ci_mac.yml'
- '.github/workflows/ci_msw.yml'
- '.github/workflows/ci_msw_cross.yml'
- '.github/workflows/docs_update.yml'
- 'build/tools/appveyor*.bat'
- 'distrib/**'
- 'docs/**'
- 'interface/**'
- 'locale/**'
- '*.md'
- '*.yml'
- 'wxwidgets.props'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
runs-on: ${{ matrix.runner }}
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu 22.04 wxGTK 3
runner: ubuntu-22.04
cmake_generator: Unix Makefiles
cmake_samples: ALL
cmake_build_toolkit: gtk3
- name: macOS 15 wxOSX Xcode
runner: macos-15
cmake_generator: Xcode
cmake_defines: -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13"
cmake_build_toolkit: osx_cocoa
- name: macOS latest wxOSX Ninja
runner: macos-latest
cmake_generator: Ninja
cmake_defines: -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DwxUSE_SYS_LIBS=OFF -DCMAKE_CXX_STANDARD=20 -DwxUSE_WEBVIEW_CHROMIUM=ON -DCMAKE_OSX_DEPLOYMENT_TARGET="10.15"
cmake_samples: ALL
cmake_tests: OFF
cmake_build_toolkit: osx_cocoa
- name: macOS latest wxGTK 3 Unix Makefiles
runner: macos-latest
cmake_generator: Unix Makefiles
cmake_samples: SOME
cmake_tests: OFF
cmake_build_toolkit: gtk3
- name: macOS 15 wxIOS
runner: macos-15
cmake_generator: Xcode
cmake_defines: -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_FIND_ROOT_PATH=/usr/local -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO
cmake_samples: OFF
cmake_tests: OFF
cmake_build_toolkit: osx_iphone
- name: MSW/MSVC wxMSW
runner: windows-latest
no_sudo: 1
cmake_defines: -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe
cmake_generator: Ninja
cmake_samples: SOME
cmake_tests: CONSOLE_ONLY
cmake_build_toolkit: msw
- name: MSW/MSVC wxQt 5.15
runner: windows-2022
no_sudo: 1
cmake_generator: 'Visual Studio 17 2022'
cmake_defines: -DCMAKE_BUILD_TYPE=Debug -DwxBUILD_SHARED=ON
cmake_samples: SOME
cmake_tests: ALL
cmake_build_toolkit: qt
cmake_qt_version: '5.15.*'
skip_installation: true
test_gui: 1
- name: MSW/MSVC wxQt 6.10
runner: windows-latest
no_sudo: 1
cmake_defines: -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe
cmake_generator: Ninja
cmake_samples: SOME
cmake_tests: ALL
cmake_build_toolkit: qt
cmake_qt_version: '6.10.*'
skip_installation: true
test_gui: 1
- name: MSW/Clang wxMSW
shell: msys2 {0}
runner: windows-latest
no_sudo: 1
cmake_defines: -DCMAKE_C_COMPILER=clang.exe -DCMAKE_CXX_COMPILER=clang++.exe -DCMAKE_CXX_FLAGS="-DwxENABLE_EXTRA_WARNINGS -Werror -Wsuggest-override" -DCMAKE_BUILD_TYPE=Release -DwxBUILD_DEMOS=ON -DwxUSE_WEBVIEW_EDGE=ON
cmake_generator: MinGW Makefiles
cmake_samples: ALL
cmake_tests: OFF
cmake_build_toolkit: msw
skip_installation: true
env:
wxGTK_VERSION: ${{ matrix.gtk_version && matrix.gtk_version || 3 }}
# Use bash as the shell, even under MSW where the default is PowerShell.
# Except for the MSYS2 shell, which must be used to find MSYS2 clang
# instead of native clang.
defaults:
run:
shell: ${{ matrix.shell || 'bash' }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: 'recursive'
- name: Setup MSYS2
if: matrix.cmake_generator == 'MinGW Makefiles'
uses: msys2/setup-msys2@v2
with:
msystem: mingw64
update: true
install: mingw-w64-x86_64-cmake mingw-w64-x86_64-toolchain mingw-w64-x86_64-clang
- name: Set up Homebrew
if: ${{ runner.os == 'macOS' && matrix.cmake_build_toolkit == 'gtk3' }}
uses: Homebrew/actions/setup-homebrew@main
- name: Install Homebrew packages
if: ${{ runner.os == 'macOS' && matrix.cmake_build_toolkit == 'gtk3' }}
run: brew install pkgconf gtk+3
- name: Install Qt
if: matrix.cmake_build_toolkit == 'qt'
uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.cmake_qt_version }}
cache: 'true'
aqtversion: '==3.1.*'
setup-python: 'false'
- name: Set environment variables
run: |
wxPROC_COUNT=`./build/tools/proc_count.sh`
case "${{ matrix.cmake_generator }}" in
Xcode)
# Xcode generates a lot of output, suppress it so only warnings and errors are visible
wxBUILD_ARGS="-jobs $wxPROC_COUNT -quiet"
;;
*Makefiles)
wxBUILD_ARGS=-j$wxPROC_COUNT
;;
esac
if [ -n "$wxBUILD_ARGS" ]; then
echo wxBUILD_ARGS=$wxBUILD_ARGS >> $GITHUB_ENV
fi
cmake_tests=${{ matrix.cmake_tests }}
if [ -z $cmake_tests ]; then cmake_tests=CONSOLE_ONLY; fi
echo wxCMAKE_TESTS=$cmake_tests >> $GITHUB_ENV
cmake_samples=${{ matrix.cmake_samples }}
if [ -z $cmake_samples ]; then cmake_samples=SOME; fi
echo wxCMAKE_SAMPLES=$cmake_samples >> $GITHUB_ENV
cmake_build_toolkit=${{ matrix.cmake_build_toolkit }}
echo wxCMAKE_BUILD_TOOLKIT=$cmake_build_toolkit >> $GITHUB_ENV
echo QT_QPA_PLATFORM_PLUGIN_PATH=${QT_ROOT_DIR}/plugins/platforms >> $GITHUB_ENV
echo QT_USE_NATIVE_WINDOWS=1 >> $GITHUB_ENV
echo QTEST_QPA_MOUSE_HANDLING=1 >> $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
- name: Before install
run: |
./build/tools/before_install.sh
# required for CMake to find Ninja but shouldn't be used when using
# MSYS2, or we'd end up using MSVC clang instead of its own.
- name: Setup MSVC Environment
if: ${{ runner.os == 'Windows' && matrix.cmake_generator != 'MinGW Makefiles' }}
uses: step-security/gha-setup-vsdevenv@v6
- name: Configuring
run: |
cmake --version
mkdir build_cmake
pushd build_cmake
cmake -G "${{ matrix.cmake_generator }}" ${{ matrix.cmake_defines }} -DwxBUILD_SAMPLES=$wxCMAKE_SAMPLES -DwxBUILD_TESTS=$wxCMAKE_TESTS -DwxBUILD_TOOLKIT=$wxCMAKE_BUILD_TOOLKIT ..
- name: Building
working-directory: build_cmake
run: |
cmake --build . -- $wxBUILD_ARGS
- name: Installing
working-directory: build_cmake
run: |
if [ -z "${{ matrix.no_sudo }}" ]; then
sudo cmake --build . --target install
else
cmake --build . --target install
fi
- name: Setup Go
if: matrix.cmake_tests != 'OFF'
uses: actions/setup-go@v6
with:
go-version: '1'
cache: false
- name: Testing
if: matrix.cmake_tests != 'OFF'
working-directory: build_cmake
run: |
. ../build/tools/httpbin.sh
httpbin_launch
ctest -V -C Debug --output-on-failure --interactive-debug-mode 0 . || rc=$?
if [ -n "$rc" ]; then
httpbin_show_log
exit $rc
fi
- name: Testing GUI
if: matrix.test_gui == '1'
working-directory: build_cmake\lib\vc_x64_dll
run: |
./test_gui.exe
- name: Testing installation
if: matrix.skip_installation != true
run: |
mkdir build_cmake_install_test
pushd build_cmake_install_test
cmake -G "${{ matrix.cmake_generator }}" ${{ matrix.cmake_defines }} ../samples/minimal
cmake --build .