Switch macOS CI to aqt Qt install to avoid Homebrew cmake tap conflic… #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: macOS Test Build | |
| on: | |
| push: | |
| branches: | |
| - issue-7133-macos-test | |
| pull_request: | |
| env: | |
| QT_VERSION: "6.5.3" # adjust if your project expects a different Qt 6.x | |
| jobs: | |
| build-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Show toolchain | |
| run: | | |
| which cmake || true | |
| cmake --version || true | |
| uname -a | |
| - name: Cache Qt | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/Qt | |
| key: qt-${{ runner.os }}-${{ env.QT_VERSION }} | |
| - name: Install aqtinstall (Qt downloader) | |
| run: | | |
| python3 -m pip install --user --upgrade aqtinstall | |
| - name: Install Qt ${{ env.QT_VERSION }} with modules (no Homebrew) | |
| run: | | |
| if [ ! -d "$HOME/Qt/${QT_VERSION}/macos" ]; then | |
| python3 -m aqt install-qt mac desktop "${QT_VERSION}" -O "$HOME/Qt" \ | |
| --modules qtdeclarative,qtquickcontrols2,qtpositioning,qtserialport,qtmultimedia,qtsvg,qtlocation,qtshadertools | |
| fi | |
| ls -la "$HOME/Qt/${QT_VERSION}/macos" | |
| - name: Ensure Ninja exists (preinstalled on runner) | |
| run: | | |
| ninja --version || brew install ninja | |
| - name: Configure (CMake + Qt6) | |
| env: | |
| CMAKE_PREFIX_PATH: ${{ runner.home }}/Qt/${{ env.QT_VERSION }}/macos | |
| run: | | |
| mkdir -p build | |
| cd build | |
| cmake .. \ | |
| -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=Release | |
| - name: Build | |
| run: | | |
| cd build | |
| ninja -v |