diff --git a/.github/workflows/_build-shared.yml b/.github/workflows/_build-shared.yml index b6f8d8b..7e645c9 100644 --- a/.github/workflows/_build-shared.yml +++ b/.github/workflows/_build-shared.yml @@ -15,6 +15,19 @@ on: qt_version: required: true type: string + qt_arch: # get rid of this, eventually, by detecting the correct Qt architecture based on the OS and compiler- + description: Qt architecture passed to jurplel/install-qt-action (e.g. clang_64 for macOS Intel). + required: false + type: string + default: '' + setup_env_script: + description: > + Optional shell script run after Qt is installed and before CMake configure. + Use this to configure the build environment (e.g. install Rosetta, export + CMAKE_OSX_ARCHITECTURES). When omitted the step is skipped entirely. + required: false + type: string + default: '' jobs: build: @@ -27,10 +40,16 @@ jobs: shell: bash run: echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + - name: Set up environment + if: ${{ inputs.setup_env_script }} + shell: bash + run: ${{ inputs.setup_env_script }} + - name: Install Qt uses: jurplel/install-qt-action@v4 with: version: ${{ inputs.qt_version }} + arch: ${{ inputs.qt_arch }} install-deps: 'true' set-env: 'true' @@ -40,6 +59,7 @@ jobs: -DCMAKE_C_COMPILER=${{ inputs.c_compiler }} -DCMAKE_CXX_COMPILER=${{ inputs.cpp_compiler }} -DCMAKE_BUILD_TYPE=Release + ${{ steps.strings.outputs.osx_arch_flag }} -S ${{ github.workspace }} - name: Build diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 0900949..32173d3 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -6,11 +6,13 @@ on: branches: [main, develop] paths-ignore: - '*.md' + - 'docs/**' pull_request: branches: [main, develop] paths-ignore: - '*.md' + - 'docs/**' jobs: get-matrix: diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 87c474c..a0a44b8 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -6,11 +6,13 @@ on: branches: [main, develop] paths-ignore: - '*.md' + - 'docs/**' pull_request: branches: [main, develop] paths-ignore: - '*.md' + - 'docs/**' jobs: get-matrix: @@ -32,10 +34,15 @@ jobs: uses: ./.github/workflows/_build-shared.yml with: - os: macos-13 # Intel-based macOS + os: macos-latest # ARM runner; Intel x86_64 binaries built and run via Rosetta 2 c_compiler: ${{ matrix.c_compiler }} cpp_compiler: ${{ matrix.cpp_compiler }} qt_version: ${{ matrix.qt_version }} + qt_arch: clang_64 # x86_64 Qt binary for Intel cross-compilation + setup_env_script: | + # Install Rosetta 2 so x86_64 test binaries can run on the ARM64 runner. + softwareupdate --install-rosetta --agree-to-license || true + echo "CMAKE_OSX_ARCHITECTURES=x86_64" >> "$GITHUB_ENV" build-macos-arm: name: macos-${{ matrix.c_compiler }}-qt${{ matrix.qt_version }}-arm @@ -51,7 +58,7 @@ jobs: - c_compiler: clang cpp_compiler: clang++ exclude: - # Exclude Qt5 versions for ARM builds + # Qt5 has no native Apple Silicon (ARM64) support; ARM macOS binaries require Qt6+ - qt_version: "5.9.*" - qt_version: "5.12.*" - qt_version: "5.15.*" diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index bab5d35..f688330 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -6,11 +6,13 @@ on: branches: [main, develop] paths-ignore: - '*.md' + - 'docs/**' pull_request: branches: [main, develop] paths-ignore: - '*.md' + - 'docs/**' jobs: get-matrix: