Skip to content

Merge pull request #265 from ddalcino/topic/ddalcino/fix-macos-12-dep… #514

Merge pull request #265 from ddalcino/topic/ddalcino/fix-macos-12-dep…

Merge pull request #265 from ddalcino/topic/ddalcino/fix-macos-12-dep… #514

Workflow file for this run

name: CI
on: [push, pull_request, workflow_dispatch]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: action/
- run: |
cd action
npm ci || npm install
shell: bash
- run: |
cd action
npm run lint
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- ubuntu-20.04
- windows-2022
- windows-2019
- macos-13
- macos-14
- macos-15
aqtversion:
- null # use whatever the default is
src-doc-examples:
- false
qt:
- version: "5.9.0"
requested: "5.9.0"
modules: qtwebengine
- version: "5.15.2"
requested: "5.15"
modules: qtwebengine
- version: "6.3.2" # Qt 6.3 is not an LTS version, so '6.3.*' always resolves to '6.3.2'
requested: "6.3.*"
# In Qt 6.2.0+, qtwebengine requires qtpositioning and qtwebchannel
modules: qtwebengine qtpositioning qtwebchannel
- version: "6.7.0"
requested: "6.7.0"
modules: qtwebengine qtpositioning qtwebchannel
- tools-only-build: true
add-tools-to-path: true
cache:
- cached
- uncached
include:
- os: ubuntu-20.04
src-doc-examples: true
source: true
src-archives: qtcharts
check-dir: ../Qt/5.15.2/Src
check: qtcharts/src/src.pro
- os: ubuntu-20.04
src-doc-examples: true
documentation: true
doc-archives: qmake
doc-modules: qtcharts qtwebengine
check-dir: ../Qt/Docs/Qt-5.15.2
check: qmake/qmake-tutorial.html qtcharts/qtcharts-index.html qtwebengine/qtwebengine-index.html
- os: ubuntu-20.04
src-doc-examples: true
examples: true
example-archives: qtsensors
example-modules: qtcharts qtwebengine
check-dir: ../Qt/Examples/Qt-5.15.2
check: charts/charts.pro sensors/sensors.pro webengine/webengine.pro
- os: ubuntu-22.04
aqtversion: "==3.1.*"
qt:
version: "5.15.2"
requested: "5.15"
modules: qtwebengine
- os: ubuntu-22.04
qt:
tools-only-build: true
add-tools-to-path: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: action/
- run: |
cd action
npm ci || npm install
shell: bash
- run: |
cd action
npm run build
- name: Install Qt with options and default aqtversion
if: ${{ !matrix.aqtversion && matrix.qt.version }}
uses: ./
with:
modules: ${{ matrix.qt.modules }}
version: ${{ matrix.qt.requested }}
tools: tools_ifw tools_qtcreator,qt.tools.qtcreator
cache: ${{ matrix.cache == 'cached' }}
- name: Install Qt with options and specified aqtversion
if: ${{ matrix.aqtversion && matrix.qt.version }}
uses: ./
with:
aqtversion: ${{ matrix.aqtversion }}
modules: ${{ matrix.qt.modules }}
version: ${{ matrix.qt.requested }}
tools: tools_ifw tools_qtcreator,qt.tools.qtcreator
cache: ${{ matrix.cache == 'cached' }}
- name: Switch macOS Xcode version with older Qt versions
if: ${{ matrix.qt.version && (startsWith(matrix.os, 'macos-13') || startsWith(matrix.os, 'macos-14')) }}
shell: pwsh
env:
QT_VERSION: ${{ matrix.qt.version }}
run: |
if ([version]$env:QT_VERSION -ge [version]"6.5.3") {
# GitHub macOS 13/14 runners use Xcode 15.0.x by default which has a known linker issue causing crashes if the artifact is run on macOS <= 12
sudo xcode-select --switch /Applications/Xcode_15.2.app
} else {
# Keep older Qt versions on Xcode 14 due to concern over QTBUG-117484
sudo xcode-select --switch /Applications/Xcode_14.3.1.app
}
- name: Configure test project on windows
if: ${{ matrix.qt.version && startsWith(matrix.os, 'windows') }}
env:
QT_VERSION: ${{ matrix.qt.version }}
run: |
cd tests/TestWithModules
for /f "delims=" %%d in ( 'vswhere.exe -latest -property installationPath' ) do @( call "%%d\VC\Auxiliary\Build\vcvars64.bat" )
IF "%QT_VERSION:~0,1%"=="5" ( dir %Qt5_DIR% ) ELSE ( dir %QT_ROOT_DIR%\lib\cmake )
qmake
cmake -S . -B ./build
shell: cmd
- name: Configure test project on unix
if: ${{ matrix.qt.version && !startsWith(matrix.os, 'windows') }}
env:
QT_VERSION: ${{ matrix.qt.version }}
run: |
cd tests/TestWithModules
if [[ $QT_VERSION == 6* ]]; then
ls "${QT_ROOT_DIR}/lib/cmake"
else
ls "${Qt5_DIR}"
fi
qmake
cmake -S . -B ./build
shell: bash
- name: Install source
if: ${{ matrix.source }}
uses: ./
with:
version: "5.15.2"
source: true
no-qt-binaries: true
src-archives: ${{ matrix.src-archives }}
- name: Install docs
if: ${{ matrix.documentation }}
uses: ./
with:
version: "5.15.2"
documentation: true
no-qt-binaries: true
doc-archives: ${{ matrix.doc-archives }}
doc-modules: ${{ matrix.doc-modules }}
- name: Install examples
if: ${{ matrix.examples }}
uses: ./
with:
version: "5.15.2"
examples: true
no-qt-binaries: true
example-archives: ${{ matrix.example-archives }}
example-modules: ${{ matrix.example-modules }}
- name: Test source, docs, examples
if: ${{ matrix.src-doc-examples }}
shell: bash
run: |
cd ${{ matrix.check-dir }}
ls ${{ matrix.check }}
- name: Install tools with options
if: ${{ matrix.qt.tools-only-build }}
uses: ./
with:
tools-only: true
tools: tools_ifw tools_qtcreator,qt.tools.qtcreator tools_cmake tools_ninja tools_conan
add-tools-to-path: ${{ matrix.qt.add-tools-to-path }}
cache: ${{ matrix.cache == 'cached' }}
- name: Test installed tools
if: ${{ matrix.qt.tools-only-build && matrix.qt.add-tools-to-path }}
shell: bash
run: |
echo "Path: ${PATH}"
set -x
# tools_ifw: use `archivegen` to test that Tools/QtInstallerFramework/4.7/bin is added to path
# tools_qtcreator: use `qbs` to test that Tools/QtCreator/bin or "Qt Creator.app/Contents/MacOS/" is added to path
# tools_cmake: test that Tools/CMake/bin or Tools/CMake/CMake.app/Contents/bin is added to path
# tools_ninja: test that Tools/Ninja is added to path
# tools_conan: test that Tools/Conan is added to path
for tool_name in archivegen qbs cmake ninja conan; do
which "${tool_name}"
"${tool_name}" --version
done
- name: Test that installed tools are not in the path
if: ${{ matrix.qt.tools-only-build && !matrix.qt.add-tools-to-path }}
shell: bash
run: |
echo "Path: ${PATH}"
set -x
# Check that QtIFW has been installed
ls ../Qt/Tools/QtInstallerFramework/*/bin/ | grep archivegen
# Check that QtCreator has been installed
[[ -e "../Qt/Tools/QtCreator/bin/qbs" || -e "../Qt/Qt Creator.app/Contents/MacOS/qbs" ]]
# Check that CMake has been installed
[[ -e "../Qt/Tools/CMake/bin/cmake" || -e "../Qt/Tools/CMake/CMake.app/Contents/bin/cmake" ]]
# Check that Ninja has been installed
[[ -e "../Qt/Tools/Ninja/ninja" ]]
# Check that Conan has been installed
[[ -e "../Qt/Tools/Conan/conan" ]]
# tools_ifw: use `archivegen` to test that Tools/QtInstallerFramework/4.7/bin is not added to path
# tools_qtcreator: use `qbs` to test that Tools/QtCreator/bin or "Qt Creator.app/Contents/MacOS/" is not added to path
# tools_cmake: test that Tools/CMake/bin or Tools/CMake/CMake.app/Contents/bin is not added to path
# tools_ninja: test that Tools/Ninja is not added to path
# tools_conan: test that Tools/Conan is not added to path
for tool_name in archivegen qbs cmake ninja conan; do
! which "${tool_name}"
! "${tool_name}" --version
done