Skip to content

Commit

Permalink
Add Qt6 CI build for macOS (#5129)
Browse files Browse the repository at this point in the history
  • Loading branch information
kintel committed May 11, 2024
1 parent dc0b6fa commit ecb06a9
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 23 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/macos-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,25 @@ on:
pull_request:

jobs:
build:
runs-on: macos-13
name: macos-13
build_and_test:
strategy:
matrix:
os: [macos-13, macos-latest]
qt: [qt5, qt6]
exclude:
# macos-latest runs on arm64, which has a broken SW renderer
- os: macos-latest
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} ${{ matrix.qt }}
# If it's not done in 60 minutes, something is wrong.
# Default is 6 hours, which is a bit long to wait.
timeout-minutes: 60
steps:
- name: Set Qt version
run: |
case ${{ matrix.qt }} in
qt6) echo "CMAKE_OPTIONS=-DUSE_QT6=1" >> $GITHUB_ENV ;;
esac
- name: Checkout
uses: actions/checkout@v4
with:
Expand All @@ -27,12 +39,12 @@ jobs:
HOMEBREW_NO_AUTO_UPDATE: 1
run: |
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
./scripts/macosx-build-homebrew.sh
./scripts/macosx-build-homebrew.sh ${{ matrix.qt }}
- name: Build OpenSCAD
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=ON -DEXPERIMENTAL=ON -DSNAPSHOT=ON
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=ON -DEXPERIMENTAL=ON -DSNAPSHOT=ON $CMAKE_OPTIONS
export NUMCPU=$(($(sysctl -n hw.ncpu) * 3 / 2))
make -j$NUMCPU
- name: Run Test Suite
Expand All @@ -46,7 +58,7 @@ jobs:
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: Test Result Report (MacOS)
name: Test Result Report (MacOS ${{ matrix.qt }})
path: |
build/Testing/Temporary/*_report.html
build/Testing/Temporary/LastTest.log
41 changes: 24 additions & 17 deletions scripts/macosx-build-homebrew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@ OPENSCADDIR=$PWD

printUsage()
{
echo "Usage: $0"
echo "Usage: $0 [qt6]"
}

log()
{
echo "$(date):" "$@"
}

# Qt5 is default
if [ "`echo $* | grep qt6`" ]; then
USE_QT6=1
fi

if [ ! -f $OPENSCADDIR/openscad.appdata.xml.in ]; then
echo "Must be run from the OpenSCAD source root directory"
exit 0
Expand Down Expand Up @@ -58,26 +63,28 @@ for formula in boost; do
fi
done

for formula in pkg-config eigen cgal glew glib opencsg freetype libzip libxml2 fontconfig harfbuzz qt5 lib3mf double-conversion imagemagick ccache ghostscript tbb; do
for formula in pkg-config eigen cgal glew glib opencsg freetype libzip libxml2 fontconfig harfbuzz lib3mf double-conversion imagemagick ccache ghostscript tbb; do
log "Installing formula $formula"
brew ls --versions $formula
time brew install $formula
done

# Link for formulas that are cached on Travis.
for formula in libzip opencsg; do
log "Linking formula $formula"
time brew link $formula
done

for formula in gettext qt5; do
log "Linking formula $formula"
time brew link --force $formula
done

# FIXME: Workaround for https://github.com/openscad/openscad/issues/5058
curl -o qscintilla2.rb https://raw.githubusercontent.com/Homebrew/homebrew-core/da59bcdf7f1dadf70e30240394ddc0bd6014affe/Formula/q/qscintilla2.rb
brew unlink qscintilla2
brew install qscintilla2.rb
if [ $USE_QT6 ]; then
for formula in qt qscintilla2; do
log "Installing formula $formula"
brew ls --versions $formula
time brew install $formula
done
else
for formula in qt5; do
log "Installing formula $formula"
brew ls --versions $formula
time brew install $formula
done
# FIXME: Workaround for https://github.com/openscad/openscad/issues/5058
curl -o qscintilla2.rb https://raw.githubusercontent.com/Homebrew/homebrew-core/da59bcdf7f1dadf70e30240394ddc0bd6014affe/Formula/q/qscintilla2.rb
brew unlink qscintilla2
brew install qscintilla2.rb
fi

$TAP untap openscad/homebrew-tap || true

0 comments on commit ecb06a9

Please sign in to comment.