Skip to content

Include Ubuntu 22.04 and Windows 2025 builds in CI #1649

Include Ubuntu 22.04 and Windows 2025 builds in CI

Include Ubuntu 22.04 and Windows 2025 builds in CI #1649

Workflow file for this run

name: Build and Test
on: [ push, pull_request ]
permissions:
contents: read
env:
# Currently, GitHub-hosted runners for public repos specify 4 cores, except macOS 14+
# See https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/
# about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
CMAKE_BUILD_PARALLEL_LEVEL: 4 # Default only; overridden where appropriate, such as on macOS 14+ below.
QT_FORCE_STDERR_LOGGING: 1 # Make sure Qt logs errors (during Workflow runs) to console. Especially for Windows.
jobs:
linux:
runs-on: ubuntu-${{ matrix.os }}${{ matrix.arch == 'arm64' && '-arm' || '' }}
strategy:
fail-fast: false
matrix:
qt:
- 5
- 5.9.9
- 5.10.1
- 5.11.3
- 5.12.12
- 5.13.2
- 5.14.2
- 5.15.2
- 6
- 6.2.4
- 6.3.2
- 6.4.3
- 6.5.3
- 6.6.3
- 6.7.3
- 6.8.3
- 6.9.1
os:
- 22.04
- 24.04
arch:
- arm64
- x86-64
cc:
- clang
- gcc
exclude:
# Qt's online installer only provides arm64 builds from Qt 6.7 onwards. Note, Ubuntu (Debian) does provide
# arm64 Qt builds, so we don't exclude `5` nor `6`, just the Qt online versions (5.x.y and 6.[0-6].y).
- { qt: 5.9.9, arch: arm64 }
- { qt: 5.10.1, arch: arm64 }
- { qt: 5.11.3, arch: arm64 }
- { qt: 5.12.12, arch: arm64 }
- { qt: 5.13.2, arch: arm64 }
- { qt: 5.14.2, arch: arm64 }
- { qt: 5.15.2, arch: arm64 }
- { qt: 6.2.4, arch: arm64 }
- { qt: 6.3.2, arch: arm64 }
- { qt: 6.4.3, arch: arm64 }
- { qt: 6.5.3, arch: arm64 }
- { qt: 6.6.3, arch: arm64 }
# Qt 6.8+ moc requires more a more recent glibc (specifically GLIBC_2.38) than Ubuntu 22.04 provides.
- { qt: 6.8.3, arch: arm64, os: 22.04 }
- { qt: 6.9.1, arch: arm64, os: 22.04 }
steps:
- name: Upgrade OS
run: |
sudo apt-mark hold firefox grub-efi-${{ matrix.arch == 'arm64' && 'arm64' || 'amd64' }}-signed
sudo apt update && sudo apt upgrade
sudo apt install lcov llvm
- uses: actions/setup-python@v5
with:
python-version: '>=3.9'
- name: Install Ubuntu's Qt5
if: matrix.qt == 5
run: sudo apt install qtbase5{,-doc}-dev qtconnectivity5-{dev,doc-html} qttools5-dev{,-tools}
- name: Install Ubuntu's Qt6
if: matrix.qt == 6
run: sudo apt install qt6-{base-dev{,-tools},connectivity-dev,l10n-tools,tools-dev{,-tools}} ${tagsPackages}
env: # The *.tags files (we want for building documentation) are not available in Ubuntu 22.04's Qt6 packages.
tagsPackages: ${{ matrix.os != '22.04' && 'qt6-base-doc-dev qt6-connectivity-doc-html' || '' }}
- name: Install online Qt version
if: contains(matrix.qt, '.') # ie if not using Ubuntu's Qt5/Qt6.
uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.qt }}
modules: ${{ startsWith(matrix.qt, '6') && 'qtconnectivity' || '' }}
setup-python: false
documentation: true
doc-archives: >-
${{ (startsWith(matrix.qt, '5.10.') || startsWith(matrix.qt, '5.11.')) && 'qt' ||
(startsWith(matrix.qt, '5') && 'qtcore qtbluetooth' || 'qtcore') }}
doc-modules: ${{ startsWith(matrix.qt, '6') && 'qtbluetooth' || '' }}
aqtversion: '>=3.2.0' # 3.2.0+ required for Qt 6.8+ support; https://github.com/miurahr/aqtinstall/issues/843
- name: Upload aqtinstall log file
if: failure()
uses: actions/upload-artifact@v4
with:
name: aqtinstall-log-linux-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.cc }}-${{ matrix.qt }}
path: aqtinstall.log
if-no-files-found: error
- name: Install linuxdeploy
uses: pcolby/install-linuxdeploy@v1
with:
plugins: qt
- uses: actions/checkout@v4
- name: Build
id: build
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cc == 'gcc' && 'g++' || 'clang++' }}
PROJECT_BUILD_ID: >-
${{ github.run_number }}.linux.${{ matrix.os }}.${{ matrix.arch }}.${{ matrix.cc }}.qt-${{ matrix.qt }}
run: |
[[ '${{ matrix.qt }}' =~ ^[56]$ ]] ||
qtInstallDocs="$RUNNER_WORKSPACE/Qt/Docs/Qt-${QT_VERSION:-${{ matrix.qt }}}"
# With coverage instrumentation (except Ubuntu 22.04's llvm-lcov version does not support `--sources`)
[[ '${{ matrix.os }}' == '22.04' && '${{ matrix.cc }}' == 'clang' ]] ||
cmake -D CMAKE_BUILD_TYPE=Release \
-D ENABLE_COVERAGE=true \
${qtInstallDocs:+-D "QT_INSTALL_DOCS=$qtInstallDocs"} \
-S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP/coverage"
# Without coverage instrumentation.
cmake -D CMAKE_BUILD_TYPE=Release \
-D ENABLE_COVERAGE=false \
${qtInstallDocs:+-D "QT_INSTALL_DOCS=$qtInstallDocs"} \
-S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP/release"
tee -a "$GITHUB_OUTPUT" <<< "dokitVersion=$(cat "$RUNNER_TEMP/release/version.txt")"
[[ '${{ matrix.os }}' == '22.04' && '${{ matrix.cc }}' == 'clang' ]] ||
cmake --build "$RUNNER_TEMP/coverage"
cmake --build "$RUNNER_TEMP/release"
[[ '${{ matrix.os }}' == '22.04' && '${{ matrix.cc }}' == 'clang' ]] ||
"$RUNNER_TEMP/coverage/src/cli/dokit" --version
"$RUNNER_TEMP/release/src/cli/dokit" --version
- name: Test w/ coverage
if: matrix.os != '22.04' || matrix.cc != 'clang'
run: ctest --output-on-failure --test-dir "$RUNNER_TEMP/coverage" --verbose
- name: Test w/o coverage
run: ctest --output-on-failure --test-dir "$RUNNER_TEMP/release" --verbose
- name: Collate test coverage
if: matrix.os != '22.04' || matrix.cc != 'clang'
run: cmake --build "$RUNNER_TEMP/coverage" --target coverage
- name: Test localisations
# \todo For unknown reasons, Qt 6.2.4 w/ GCC fails to include full set of *.qm file - happens locally too, not
# just on GitHub hosted runners. We could diagnose further, but this one corner case is very low value today.
# Note, Ubuntu 22.04's Qt6 packages are (at the time of writing) Qt 6.2.4, so they are affected also.
if: >-
startsWith(matrix.qt, '6') &&
!( matrix.cc == 'gcc' && ( startsWith(matrix.qt, '6.2.') || (matrix.qt == '6' && matrix.os == '22.04') ) )
run: |
declare -Ar languages=(
[en_AU]='Australia|Unrecognised'
[en_GB]='United Kingdom|Unrecognised'
[en_US]='United States|Unrecognized'
)
for langId in "${!languages[@]}"; do
IFS='|' read -r langName localText <<< "${languages[${langId}]}"
echo "Checking: ${langName} (${langId})"
output=$(
LANG="${langId}.UTF-8" \
"$RUNNER_TEMP/release/src/cli/dokit" calibrate --debug --temperature x 2>&1 || :)
printf '%s\n--------\n' "${output}"
grep "Locale:.*${langName}" <<< "${output}"
grep "App translations: :/i18n/cli/${langId}\.qm" <<< "${output}"
grep "Library translations: :/i18n/lib/${langId}\.qm" <<< "${output}"
grep "${localText} temperature format" <<< "${output}"
done
- name: Upload test results
if: >- # If we have coverage reports, and/or TAP files (TAP support added in Qt Test v5.12).
matrix.os != '22.04' || matrix.cc != 'clang' || !startsWith(matrix.qt, '5') ||
( startsWith(matrix.qt, '5.1') && !startsWith(matrix.qt, '5.10') && !startsWith(matrix.qt, '5.11') )
uses: actions/upload-artifact@v4
with:
name: test-results-${{ steps.build.outputs.dokitVersion }}
path: |
${{ runner.temp }}/coverage/coverage.info
${{ runner.temp }}/coverage/removeHtmlDates.sh
${{ runner.temp }}/coverage/test/**/*.tap
${{ runner.temp }}/release/test/**/*.tap
if-no-files-found: error
- name: Report parallel coverage to Codacy
if: >-
( matrix.os != '22.04' || matrix.cc == 'gcc' )
&& github.event_name == 'push' && github.actor != 'dependabot[bot]'
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
run: >
bash <(curl -Ls https://coverage.codacy.com/get.sh) report --partial \
-l CPP -r "${{ runner.temp }}/coverage/coverage.info"
- name: Report parallel coverage to Coveralls
if: >-
( matrix.os != '22.04' || matrix.cc == 'gcc' )
&& github.event_name == 'push' && github.actor != 'dependabot[bot]'
uses: coverallsapp/github-action@v2
with:
# Note, the coverage-reporter-platform option is currently undocumented. See
# https://github.com/coverallsapp/github-action/issues/218#issuecomment-2436338747
coverage-reporter-platform: ${{ matrix.arch == 'arm64' && 'aarch64' || 'x86_64' }}
file: ${{ runner.temp }}/coverage/coverage.info
format: lcov
flag-name: linux-${{ matrix.cc }}-${{ matrix.qt }}
parallel: true
- name: Build AppImage
run: cmake --build "$RUNNER_TEMP/release" --target cli-appimage
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dokit-${{ steps.build.outputs.dokitVersion }}
path: |
${{ runner.temp }}/release/src/lib/libQtPokit.so
${{ runner.temp }}/release/src/cli/dokit
if-no-files-found: error
- name: Upload AppImage
uses: actions/upload-artifact@v4
with:
name: dokit-${{ steps.build.outputs.dokitVersion }}.AppImage
path: ${{ runner.temp }}/release/dokit-${{ steps.build.outputs.dokitVersion }}.AppImage
if-no-files-found: error
mac:
runs-on: ${{ matrix.os }}
env:
CMAKE_BUILD_PARALLEL_LEVEL: ${{ matrix.os == 'macos-13' && 4 || 3 }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
qt:
- 5.9.9
- 5.10.1
- 5.11.3
- 5.12.12
- 5.13.2
- 5.14.2
- 5.15.2
- 6.2.4
- 6.3.2
- 6.4.3
- 6.5.3
- 6.6.3
- 6.7.3
- 6.8.3
- 6.9.1
os:
- macos-13
- macos-14
- macos-15
cc:
- clang
- gcc
exclude:
# GitHub's macOS 14+ gcc can only target arm64, but Qt didn't add Apple arm64 support until Qt 6.2, so:
# Exclude Qt 5.x (and 6.0, 6.1) with GCC on macOS 14+. Also see the `arch` step below for more details.
- { qt: '5.9.9', os: macos-14, cc: gcc }
- { qt: '5.9.9', os: macos-15, cc: gcc }
- { qt: '5.10.1', os: macos-14, cc: gcc }
- { qt: '5.10.1', os: macos-15, cc: gcc }
- { qt: '5.11.3', os: macos-14, cc: gcc }
- { qt: '5.11.3', os: macos-15, cc: gcc }
- { qt: '5.12.12', os: macos-14, cc: gcc }
- { qt: '5.12.12', os: macos-15, cc: gcc }
- { qt: '5.13.2', os: macos-14, cc: gcc }
- { qt: '5.13.2', os: macos-15, cc: gcc }
- { qt: '5.14.2', os: macos-14, cc: gcc }
- { qt: '5.14.2', os: macos-15, cc: gcc }
- { qt: '5.15.2', os: macos-14, cc: gcc }
- { qt: '5.15.2', os: macos-15, cc: gcc }
# Exclude Qt 5.10 with GCC on macOS. See https://bugreports.qt.io/browse/QTBUG-66585
- { qt: '5.10.1', cc: gcc }
# Exclude Qt 6.x with GCC on macOS for now. See https://bugreports.qt.io/browse/QTBUG-107050
- { qt: '6.2.4', cc: gcc }
- { qt: '6.3.2', cc: gcc }
- { qt: '6.4.3', cc: gcc }
- { qt: '6.5.3', cc: gcc }
- { qt: '6.6.3', cc: gcc }
- { qt: '6.7.3', cc: gcc }
- { qt: '6.8.3', cc: gcc }
- { qt: '6.9.1', cc: gcc }
steps:
- uses: actions/checkout@v4
- name: Install lcov
run: brew install bash lcov
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.qt }}
modules: ${{ startsWith(matrix.qt, '6') && 'qtconnectivity' || '' }}
documentation: true
doc-archives: >-
${{ (startsWith(matrix.qt, '5.10.') || startsWith(matrix.qt, '5.11.')) && 'qt' ||
(startsWith(matrix.qt, '5') && 'qtcore qtbluetooth' || 'qtcore') }}
doc-modules: ${{ startsWith(matrix.qt, '6') && 'qtbluetooth' || '' }}
aqtversion: '>=3.2.0' # 3.2.0+ required for Qt 6.8+ support; https://github.com/miurahr/aqtinstall/issues/843
- name: Upload aqtinstall log file
if: failure()
uses: actions/upload-artifact@v4
with:
name: aqtinstall-log-${{ matrix.os }}-${{ matrix.cc }}-${{ matrix.qt }}
path: aqtinstall.log
if-no-files-found: error
- name: Choose target architectures
id: arch
run: |
# Qt only supports x86-64 (not arm64) prior to Qt 6.2.0. See https://www.qt.io/blog/qt-on-apple-silicon
if [[ '${{ matrix.qt }}' =~ ^(5|6\.[01])\. ]]; then arch=x86_64
# GitHub runners' (homebrew'd) gcc's only support support x86-64 prior to macos-14, and only arm64 after.
# Note: if we attempt to use multiple archs, gcc will warn, but continue, resulting in later failures.
elif [[ '${{ matrix.cc }}' == 'gcc' ]]; then
if [[ '${{ matrix.os }}' == 'macos-13' ]]; then arch='x86_64'; else arch='arm64'; fi
# Otherwise, default to universal binaries, where possible.
else arch='arm64;x86_64'; fi
tee -a "$GITHUB_ENV" <<< "CMAKE_OSX_ARCHITECTURES=${arch}"
tee -a "$GITHUB_OUTPUT" <<< "buildId=${arch//;/-}"
- name: Choose compiler toolchain
run: |
if [[ '${{ matrix.cc }}' == 'gcc' ]]; then
tee -a "$GITHUB_ENV" <<< 'CC=gcc-14'
tee -a "$GITHUB_ENV" <<< 'CXX=g++-14'
tee -a "$GITHUB_ENV" <<< 'GCOV=gcov-14'
else
case '${{ matrix.os }}' in
macos-13) llvmPrefix=$(brew --prefix 'llvm@15') ;; # Newer than non-brew llvm (v14).
#macos-14) llvmPrefix=$(brew --prefix 'llvm@15') ;; # *Not* newer than the non-new llvm (v16).
macos-15) llvmPrefix=$(brew --prefix 'llvm@18') ;; # Newer than non-brew llvm (v17).
*) llvmPrefix='/Library/Developer/CommandLineTools/usr' ;; # Host's non-brew llvm.
esac
tee -a "$GITHUB_ENV" <<< "CC=${llvmPrefix}/bin/clang"
tee -a "$GITHUB_ENV" <<< "CXX=${llvmPrefix}/bin/clang++"
tee -a "$GITHUB_ENV" <<< "LLVM_COV=${llvmPrefix}/bin/llvm-cov"
tee -a "$GITHUB_ENV" <<< "LLVM_PROFDATA=${llvmPrefix}/bin/llvm-profdata"
fi
- name: Build
id: build
env:
PROJECT_BUILD_ID: "${{ github.run_number }}.${{ matrix.os }}.${{ steps.arch.outputs.buildId }}.\
${{ matrix.cc }}.qt-${{ matrix.qt }}"
run: |
# With coverage instrumentation (except macOS 13's llvm-lcov version does not support the --sources option)
[[ '${{ matrix.os }}' == 'macos-13' && '${{ matrix.cc }}' == 'clang' ]] ||
cmake -D CMAKE_BUILD_TYPE=Release \
-D CODECOV_GCOV="${GCOV:-}" \
-D ENABLE_COVERAGE=true \
-D LLVM_COV="${LLVM_COV:-}" \
-D LLVM_PROFDATA="${LLVM_PROFDATA:-}" \
-D QT_INSTALL_DOCS="$RUNNER_WORKSPACE/Qt/Docs/Qt-${{ matrix.qt }}" \
-S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP/coverage"
# Without coverage instrumentation.
cmake -D CMAKE_BUILD_TYPE=Release \
-D ENABLE_COVERAGE=false \
-D QT_INSTALL_DOCS="$RUNNER_WORKSPACE/Qt/Docs/Qt-${{ matrix.qt }}" \
-S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP/release"
tee -a "$GITHUB_OUTPUT" <<< "dokitVersion=$(cat "$RUNNER_TEMP/release/version.txt")"
{ echo -n 'tap='; [[ '${{ matrix.qt }}' =~ ^5\.1[2-9]|6 ]] && echo true || echo false; } |
tee -a "$GITHUB_OUTPUT"
[[ '${{ matrix.os }}' == 'macos-13' && '${{ matrix.cc }}' == 'clang' ]] ||
cmake --build "$RUNNER_TEMP/coverage" -- VERBOSE=1
cmake --build "$RUNNER_TEMP/release" -- VERBOSE=1
"$RUNNER_TEMP/release/src/cli/dokit.app/Contents/MacOS/dokit" --version
[[ '${{ matrix.os }}' == 'macos-13' && '${{ matrix.cc }}' == 'clang' ]] ||
"$RUNNER_TEMP/coverage/src/cli/dokit.app/Contents/MacOS/dokit" --version
- name: Grant Bluetooth access # Only needed for unit tests with older Qt's on newer runners.
if: matrix.os != 'macos-13' && ( startsWith(matrix.qt, '5') || startsWith(matrix.qt, '6.2.') )
run: >
sudo sqlite3 "$HOME/Library/Application Support/com.apple.TCC/TCC.db" "INSERT or REPLACE INTO access
( service, client, client_type, auth_value, auth_reason, auth_version, flags ) VALUES
( 'kTCCServiceBluetoothAlways', '/usr/local/opt/runner/provisioner/provisioner', 1, 2, 3, 1, 0 )"
- name: Test w/ coverage
if: matrix.os != 'macos-13' || matrix.cc != 'clang'
run: ctest --output-on-failure --test-dir "$RUNNER_TEMP/coverage" --verbose
timeout-minutes: 1
- name: Test w/o coverage
run: ctest --output-on-failure --test-dir "$RUNNER_TEMP/release" --verbose
timeout-minutes: 1
- name: Test localisations
if: startsWith(matrix.qt, '6')
run: |
declare -Ar languages=(
[en_AU]='Australia|Unrecognised'
[en_GB]='United Kingdom|Unrecognised'
[en_US]='United States|Unrecognized'
)
for langId in "${!languages[@]}"; do
IFS='|' read -r langName localText <<< "${languages[${langId}]}"
echo "Checking: ${langName} (${langId})"
output=$(
LANG="${langId}.UTF-8" \
"$RUNNER_TEMP/release/src/cli/dokit.app/Contents/MacOS/dokit" calibrate --debug --temperature x 2>&1 || :)
printf '%s\n--------\n' "${output}"
grep "Locale:.*${langName}" <<< "${output}"
grep "App translations: :/i18n/cli/${langId}\.qm" <<< "${output}"
grep "Library translations: :/i18n/lib/${langId}\.qm" <<< "${output}"
grep "${localText} temperature format" <<< "${output}"
done
- name: Disable lcov consistency checks for gcc
if: matrix.cc == 'gcc'
run: echo 'check_data_consistency = 0' >> "$HOME/.lcovrc"
- name: Collate test coverage
if: matrix.os != 'macos-13' || matrix.cc == 'gcc'
run: cmake --build "$RUNNER_TEMP/coverage" --target coverage
- name: Upload test results
if: matrix.os != 'macos-13' || fromJSON(steps.build.outputs.tap)
uses: actions/upload-artifact@v4
with:
name: test-results-${{ steps.build.outputs.dokitVersion }}
path: |
${{ runner.temp }}/coverage/coverage.info
${{ runner.temp }}/coverage/removeHtmlDates.sh
${{ runner.temp }}/coverage/test/**/*.tap
${{ runner.temp }}/release/test/**/*.tap
if-no-files-found: error
- name: Report parallel coverage to Codacy
if: >-
( matrix.os != 'macos-13' || matrix.cc == 'gcc' )
&& github.event_name == 'push' && github.actor != 'dependabot[bot]'
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
run: >
bash <(curl -Ls https://coverage.codacy.com/get.sh) report --partial \
-l CPP -r "${{ runner.temp }}/coverage/coverage.info"
- name: Report parallel coverage to Coveralls
if: >-
( matrix.os != 'macos-13' || matrix.cc == 'gcc' )
&& github.event_name == 'push' && github.actor != 'dependabot[bot]'
uses: coverallsapp/github-action@v2
with:
file: ${{ runner.temp }}/coverage/coverage.info
format: lcov
flag-name: mac-${{ matrix.cc }}-${{ matrix.qt }}
parallel: true
- name: Make app bundle
run: macdeployqt "$RUNNER_TEMP/release/src/cli/dokit.app" -dmg -verbose=2
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dokit-${{ steps.build.outputs.dokitVersion }}
path: ${{ runner.temp }}/release/src/cli/*.app
if-no-files-found: error
win:
runs-on: windows-${{ matrix.os }}
defaults: { run: { shell: cmd } }
strategy:
fail-fast: false
matrix:
qt:
- 5.9.9
- 5.10.1
- 5.11.3
- 5.12.12
- 5.13.2
- 5.14.2
- 5.15.2
- 6.2.4
- 6.3.2
- 6.4.3
- 6.5.3
- 6.6.3
- 6.7.3
- 6.8.3
- 6.9.1
os:
- '2022'
- '2025'
arch: [ x86, x86-64, arm64 ]
toolchain: [ llvm, mingw, msvc ]
exclude:
# Exclude arm64 builds for Qt's earlier than 6.2, since Qt only added (Windows) arm64
# 'Technology Preview' support in 6.2.
- { arch: arm64, qt: '5.9.9' }
- { arch: arm64, qt: '5.10.1' }
- { arch: arm64, qt: '5.11.3' }
- { arch: arm64, qt: '5.12.12' }
- { arch: arm64, qt: '5.13.2' }
- { arch: arm64, qt: '5.14.2' }
- { arch: arm64, qt: '5.15.2' }
# Exclude MinGW (including LLVM) builds for arm64, since Qt does not provide those binaries yet.
- { arch: arm64, toolchain: llvm }
- { arch: arm64, toolchain: mingw }
# Exclude LLVM builds for x86, since neither Qt nor GitHub runners provide 32-bit LLVM MinGW binaries.
- { arch: x86, toolchain: llvm }
# Exclude x86 (32-bit) builds for Qt 5.10.1 with MSVC. See https://bugreports.qt.io/browse/QTBUG-67259
- { arch: x86, qt: '5.10.1', toolchain: msvc }
# Exclude x86 (32-bit) builds for Qt 6.x, since the Qt online installer dropped those.
- { arch: x86, qt: '6.2.4' }
- { arch: x86, qt: '6.3.2' }
- { arch: x86, qt: '6.4.3' }
- { arch: x86, qt: '6.5.3' }
- { arch: x86, qt: '6.6.3' }
- { arch: x86, qt: '6.7.3' }
- { arch: x86, qt: '6.8.3' }
- { arch: x86, qt: '6.9.1' }
# Exclude MinGW (including LLVM) builds for x86-64 with Qt's earlier than 5.12, since the Qt online
# installer (as used by aqtinstaller) did not include x86-64 binaries until Qt 5.12.
- { arch: x86-64, qt: '5.9.9', toolchain: llvm }
- { arch: x86-64, qt: '5.9.9', toolchain: mingw }
- { arch: x86-64, qt: '5.10.1', toolchain: llvm }
- { arch: x86-64, qt: '5.10.1', toolchain: mingw }
- { arch: x86-64, qt: '5.11.3', toolchain: llvm }
- { arch: x86-64, qt: '5.11.3', toolchain: mingw }
# Exclude LLVM builds before Qt 6.7, since Qt didn't begin shipping llvm-mingw support until then.
- { toolchain: llvm, qt: '5.9.9' }
- { toolchain: llvm, qt: '5.10.1' }
- { toolchain: llvm, qt: '5.11.3' }
- { toolchain: llvm, qt: '5.12.12' }
- { toolchain: llvm, qt: '5.13.2' }
- { toolchain: llvm, qt: '5.14.2' }
- { toolchain: llvm, qt: '5.15.2' }
- { toolchain: llvm, qt: '6.2.4' }
- { toolchain: llvm, qt: '6.3.2' }
- { toolchain: llvm, qt: '6.4.3' }
- { toolchain: llvm, qt: '6.5.3' }
- { toolchain: llvm, qt: '6.6.3' }
# \todo Exclude some additional 64-bit MinGW builds on Windows 2025 (only) for now, as they segfault on
# std::cout. Probably due to some incompatibly runtime linkage.
- { toolchain: mingw, arch: x86-64, qt: '5.12.12', os: '2025' }
- { toolchain: mingw, arch: x86-64, qt: '5.13.2', os: '2025' }
- { toolchain: mingw, arch: x86-64, qt: '6.2.4', os: '2025' }
- { toolchain: mingw, arch: x86-64, qt: '6.3.2', os: '2025' }
include:
# Map the aqtinstall (aqt) architectures.
- { qt: '5.9.9', toolchain: mingw, arch: x86, aqtArch: win32_mingw53 }
- { qt: '5.9.9', toolchain: msvc, arch: x86, aqtArch: win32_msvc2015 }
- { qt: '5.9.9', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2013_64 }
- { qt: '5.9.9', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2015_64 }
- { qt: '5.9.9', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2017_64 }
- { qt: '5.10.1', toolchain: mingw, arch: x86, aqtArch: win32_mingw53 }
# { qt: '5.10.1', toolchain: msvc, arch: x86, aqtArch: win32_msvc2015 } # Excluded above (QTBUG-67259).
- { qt: '5.10.1', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2013_64 }
- { qt: '5.10.1', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2015_64 }
- { qt: '5.10.1', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2017_64 }
- { qt: '5.11.3', toolchain: mingw, arch: x86, aqtArch: win32_mingw53 }
- { qt: '5.11.3', toolchain: msvc, arch: x86, aqtArch: win32_msvc2015 }
- { qt: '5.11.3', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2015_64 }
- { qt: '5.11.3', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2017_64 }
- { qt: '5.12.12', toolchain: mingw, arch: x86, aqtArch: win32_mingw73 }
- { qt: '5.12.12', toolchain: mingw, arch: x86-64, aqtArch: win64_mingw73 }
- { qt: '5.12.12', toolchain: msvc, arch: x86, aqtArch: win32_msvc2017 }
- { qt: '5.12.12', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2015_64 }
- { qt: '5.12.12', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2017_64 }
- { qt: '5.13.2', toolchain: mingw, arch: x86, aqtArch: win32_mingw73 }
- { qt: '5.13.2', toolchain: mingw, arch: x86-64, aqtArch: win64_mingw73 }
- { qt: '5.13.2', toolchain: msvc, arch: x86, aqtArch: win32_msvc2017 }
- { qt: '5.13.2', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2015_64 }
- { qt: '5.13.2', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2017_64 }
- { qt: '5.14.2', toolchain: mingw, arch: x86, aqtArch: win32_mingw73 }
- { qt: '5.14.2', toolchain: mingw, arch: x86-64, aqtArch: win64_mingw73 }
- { qt: '5.14.2', toolchain: msvc, arch: x86, aqtArch: win32_msvc2017 }
- { qt: '5.14.2', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2015_64 }
- { qt: '5.14.2', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2017_64 }
- { qt: '5.15.2', toolchain: mingw, arch: x86, aqtArch: win32_mingw81 }
- { qt: '5.15.2', toolchain: mingw, arch: x86-64, aqtArch: win64_mingw81 }
- { qt: '5.15.2', toolchain: msvc, arch: x86, aqtArch: win32_msvc2019 }
- { qt: '5.15.2', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2015_64 }
- { qt: '5.15.2', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2019_64 }
- { qt: '6.2.4', toolchain: mingw, arch: x86-64, aqtArch: win64_mingw }
- { qt: '6.2.4', toolchain: msvc, arch: arm64, aqtArch: win64_msvc2019_arm64 }
- { qt: '6.2.4', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2019_64 }
- { qt: '6.3.2', toolchain: mingw, arch: x86-64, aqtArch: win64_mingw }
- { qt: '6.3.2', toolchain: msvc, arch: arm64, aqtArch: win64_msvc2019_arm64 }
- { qt: '6.3.2', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2019_64 }
- { qt: '6.4.3', toolchain: mingw, arch: x86-64, aqtArch: win64_mingw }
- { qt: '6.4.3', toolchain: msvc, arch: arm64, aqtArch: win64_msvc2019_arm64 }
- { qt: '6.4.3', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2019_64 }
- { qt: '6.5.3', toolchain: mingw, arch: x86-64, aqtArch: win64_mingw }
- { qt: '6.5.3', toolchain: msvc, arch: arm64, aqtArch: win64_msvc2019_arm64 }
- { qt: '6.5.3', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2019_64 }
- { qt: '6.6.3', toolchain: mingw, arch: x86-64, aqtArch: win64_mingw }
- { qt: '6.6.3', toolchain: msvc, arch: arm64, aqtArch: win64_msvc2019_arm64 }
- { qt: '6.6.3', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2019_64 }
- { qt: '6.7.3', toolchain: llvm, arch: x86-64, aqtArch: win64_llvm_mingw }
- { qt: '6.7.3', toolchain: mingw, arch: x86-64, aqtArch: win64_mingw }
- { qt: '6.7.3', toolchain: msvc, arch: arm64, aqtArch: win64_msvc2019_arm64 }
- { qt: '6.7.3', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2019_64 }
- { qt: '6.8.3', toolchain: llvm, arch: x86-64, aqtArch: win64_llvm_mingw }
- { qt: '6.8.3', toolchain: mingw, arch: x86-64, aqtArch: win64_mingw }
- { qt: '6.8.3', toolchain: msvc, arch: arm64, aqtArch: win64_msvc2022_arm64_cross_compiled }
- { qt: '6.8.3', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2022_64 }
- { qt: '6.9.1', toolchain: llvm, arch: x86-64, aqtArch: win64_llvm_mingw }
- { qt: '6.9.1', toolchain: mingw, arch: x86-64, aqtArch: win64_mingw }
- { qt: '6.9.1', toolchain: msvc, arch: arm64, aqtArch: win64_msvc2022_arm64_cross_compiled }
- { qt: '6.9.1', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2022_64 }
# Map the MSVC architecture.
- { toolchain: msvc, arch: arm64, msvcArch: amd64_arm64 }
- { toolchain: msvc, arch: x86, msvcArch: amd64_x86 }
- { toolchain: msvc, arch: x86-64, msvcArch: amd64 }
# Define the generator and dll names per toolchain.
- { toolchain: 'llvm', generator: 'MinGW Makefiles', dll: libQtPokit.dll }
- { toolchain: 'mingw', generator: 'MinGW Makefiles', dll: libQtPokit.dll }
- { toolchain: 'msvc', generator: 'NMake Makefiles', dll: QtPokit.dll }
# Use Qt-provided 64-bit MinGW for recent Qt's (defaulting to GitHub's 12.2.0 version for older Qt versions).
- { toolchain: 'mingw', arch: x86-64, qt: '5.14.2', aqtTools: 'tools_mingw1310' }
- { toolchain: 'mingw', arch: x86-64, qt: '5.15.2', aqtTools: 'tools_mingw1310' }
- { toolchain: 'mingw', arch: x86-64, qt: '6.4.3', aqtTools: 'tools_mingw1310' }
- { toolchain: 'mingw', arch: x86-64, qt: '6.5.3', aqtTools: 'tools_mingw1310' }
- { toolchain: 'mingw', arch: x86-64, qt: '6.6.3', aqtTools: 'tools_mingw1310' }
- { toolchain: 'llvm', arch: x86-64, qt: '6.7.3', aqtTools: 'tools_llvm_mingw1706' }
- { toolchain: 'mingw', arch: x86-64, qt: '6.7.3', aqtTools: 'tools_mingw1310' }
- { toolchain: 'llvm', arch: x86-64, qt: '6.8.3', aqtTools: 'tools_llvm_mingw1706' }
- { toolchain: 'mingw', arch: x86-64, qt: '6.8.3', aqtTools: 'tools_mingw1310' }
- { toolchain: 'llvm', arch: x86-64, qt: '6.9.1', aqtTools: 'tools_llvm_mingw1706' }
- { toolchain: 'mingw', arch: x86-64, qt: '6.9.1', aqtTools: 'tools_mingw1310' }
## Windows Server 2025-specific cases.
- { os: '2025', toolchain: 'mingw', arch: x86, qt: '5.9.9',
aqtTools: 'tools_mingw81,qt.tools.win32_mingw810' }
- { os: '2025', toolchain: 'mingw', arch: x86, qt: '5.10.1',
aqtTools: 'tools_mingw81,qt.tools.win32_mingw810' }
- { os: '2025', toolchain: 'mingw', arch: x86, qt: '5.11.3',
aqtTools: 'tools_mingw81,qt.tools.win32_mingw810' }
- { os: '2025', toolchain: 'mingw', arch: x86, qt: '5.12.12',
aqtTools: 'tools_mingw81,qt.tools.win32_mingw810' }
- { os: '2025', toolchain: 'mingw', arch: x86, qt: '5.13.2',
aqtTools: 'tools_mingw81,qt.tools.win32_mingw810' }
steps:
- name: Configure path
if: matrix.toolchain != 'msvc'
shell: bash
run: |
# Paths needed for MSYS2's LCOV to function properly. Note, its important that we add the mingw64 one here
# before any later mingw installs (including those from install-qt-action) or this would interfere with those.
tee -a "$GITHUB_PATH" <<< 'C:\msys64\usr\bin' # Else geninfo will fail to find .gcda files (not sure why).
tee -a "$GITHUB_PATH" <<< 'C:\msys64\mingw64\bin' # Else lcov will fail to find its own geninfo command.
# For 32-bit (x86) MinGW builds, place GitHub's mingw32 at the head of the path (install-qt-actions would
# supersede this below, but we never install (32-bit) mingw32 via install-qt-actions, so not an issue).
[[ '${{ matrix.toolchain }}' != 'mingw' || '${{ matrix.arch }}' != 'x86' ]] ||
tee -a "$GITHUB_PATH" <<< 'C:\mingw32\bin'
- name: Install LCOV
if: matrix.toolchain != 'msvc'
run: pacman --sync --noconfirm --verbose mingw-w64-x86_64-lcov
- uses: actions/checkout@v4
- name: Install host Qt for cross-compilation
if: matrix.arch == 'arm64'
uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.qt }}
arch: ${{ startsWith(matrix.aqtArch, 'win64_msvc2019') && 'win64_msvc2019' || 'win64_msvc2022' }}_64
set-env: false
aqtversion: '>=3.2.0' # 3.2.0+ required for Qt 6.8+ support; https://github.com/miurahr/aqtinstall/issues/843
- name: Upload aqtinstall log file
if: matrix.arch == 'arm64' && failure()
uses: actions/upload-artifact@v4
with:
name: aqtinstall-log-win-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.toolchain }}-${{ matrix.qt }}-cross
path: aqtinstall.log
if-no-files-found: error
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.qt }}
modules: ${{ startsWith(matrix.qt, '6') && 'qtconnectivity' || '' }}
arch: ${{ matrix.aqtArch }}
tools: ${{ matrix.aqtTools }}
add-tools-to-path: true
documentation: true
doc-archives: >-
${{ (startsWith(matrix.qt, '5.10.') || startsWith(matrix.qt, '5.11.')) && 'qt' ||
(startsWith(matrix.qt, '5') && 'qtcore qtbluetooth' || 'qtcore') }}
doc-modules: ${{ startsWith(matrix.qt, '6') && 'qtbluetooth' || '' }}
aqtversion: '>=3.2.0' # 3.2.0+ required for Qt 6.8+ support; https://github.com/miurahr/aqtinstall/issues/843
- name: Upload aqtinstall log file
if: failure()
uses: actions/upload-artifact@v4
with:
name: aqtinstall-log-win-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.toolchain }}-${{ matrix.qt }}
path: aqtinstall.log
if-no-files-found: error
- name: Configure cross-compilation
if: matrix.arch == 'arm64'
shell: bash
run: |
tee -a "${GITHUB_ENV}" <<< "CMAKE_TOOLCHAIN_FILE=${QT_ROOT_DIR/_64/_arm64/}\lib\cmake\Qt6\qt.toolchain.cmake"
tee -a "${GITHUB_ENV}" <<< "qtHostPath=${QT_ROOT_DIR/_arm64/_64}"
- name: Configure MSVC
if: matrix.toolchain == 'msvc'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.msvcArch }}
toolset: ${{ startsWith(matrix.qt, '5') && '14.29' || '' }} # MSVC 14.38+ has many deprecation issues w/ Qt5.
- name: Build w/ coverage instrumentation
if: matrix.toolchain != 'msvc'
env:
CMAKE_MESSAGE_LOG_LEVEL: VERBOSE
PROJECT_BUILD_ID: >-
${{ github.run_number }}.win${{ matrix.os }}.${{ matrix.arch }}.${{ matrix.toolchain }}.qt-${{ matrix.qt }}
run: |
cmake -D CMAKE_BUILD_TYPE=Release ^
-D ENABLE_COVERAGE=true ^
-D QT_HOST_PATH=%qtHostPath% ^
-D QT_INSTALL_DOCS=%RUNNER_WORKSPACE%\Qt\Docs\Qt-${{ matrix.qt }} ^
-G "${{ matrix.generator }}" -S "%GITHUB_WORKSPACE%" -B "%RUNNER_TEMP%/coverage"
cmake --build "%RUNNER_TEMP%/coverage" --verbose
- name: Build w/o coverage instrumentation
env:
CMAKE_MESSAGE_LOG_LEVEL: VERBOSE
PROJECT_BUILD_ID: >-
${{ github.run_number }}.win${{ matrix.os }}.${{ matrix.arch }}.${{ matrix.toolchain }}.qt-${{ matrix.qt }}
run: |
cmake -D CMAKE_BUILD_TYPE=Release ^
-D ENABLE_COVERAGE=false ^
-D QT_HOST_PATH=%qtHostPath% ^
-D QT_INSTALL_DOCS=%RUNNER_WORKSPACE%\Qt\Docs\Qt-${{ matrix.qt }} ^
-G "${{ matrix.generator }}" -S "%GITHUB_WORKSPACE%" -B "%RUNNER_TEMP%/release"
cmake --build "%RUNNER_TEMP%/release" --verbose
- name: Capture build-output variables
id: post-build
shell: bash
run: |
tee -a "${GITHUB_OUTPUT}" <<< "dokitVersion=$(cat "$RUNNER_TEMP/release/version.txt")"
{ echo -n 'tap='; [[ '${{ matrix.qt }}' =~ ^5\.1[2-9]|6 ]] && echo true || echo false; } |
tee -a "$GITHUB_OUTPUT"
- name: Install DLL for tests w/ coverage
if: matrix.toolchain != 'msvc'
run: |
copy /v /b src\lib\${{ matrix.dll }} /b test\unit\cli
copy /v /b src\lib\${{ matrix.dll }} /b test\unit\lib
working-directory: ${{ runner.temp }}/coverage
- name: Install DLL for tests w/o coverage
run: |
copy /v /b src\lib\${{ matrix.dll }} /b test\unit\cli
copy /v /b src\lib\${{ matrix.dll }} /b test\unit\lib
working-directory: ${{ runner.temp }}/release
# \todo Remove this step when https://github.com/llvm/llvm-project/issues/110975 is resolved.
- name: Test StatusService for LLVM debugging
if: matrix.toolchain == 'llvm'
shell: bash
run: '"${RUNNER_TEMP}/coverage/test/unit/lib/testStatusService.exe" -o output,txt || :; cat output'
- name: Test w/ coverage # We can't execute arm64 binaries on an x86-64 host.
if: matrix.arch != 'arm64' && matrix.toolchain != 'msvc'
run: ctest --output-on-failure --test-dir "%RUNNER_TEMP%/coverage" --verbose
- name: Test w/o coverage # We can't execute arm64 binaries on an x86-64 host.
if: matrix.arch != 'arm64'
run: ctest --output-on-failure --test-dir "%RUNNER_TEMP%/release" --verbose
- name: Collate test coverage # Currently available on MinGW builds only.
# \todo The MinGW versions needed for building and testing on 32-bin binaries on Windows 2025 with Qt 5.9 to
# 5.13, include a gcov binaries that can't be spawned by geninfo. We could probably work around this by somehow
# overriding `gcov.exe` and/or `geninfo` binaries (to us the host's), but this is a low priority.
if: >-
matrix.toolchain == 'mingw' && !( matrix.os == '2025' && matrix.arch == 'x86' &&
contains(fromJSON('["5.9.9", "5.10.1", "5.11.3", "5.12.12", "5.13.2"]'), matrix.qt) )
run: cmake --build "%RUNNER_TEMP%/coverage" --target coverage --verbose
- name: Upload test results
if: matrix.arch != 'arm64' && ( matrix.toolchain != 'msvc' || fromJSON(steps.post-build.outputs.tap) )
uses: actions/upload-artifact@v4
with:
name: test-results-${{ steps.post-build.outputs.dokitVersion }}
path: |
${{ runner.temp }}/coverage/coverage.info
${{ runner.temp }}/coverage/removeHtmlDates.sh
${{ runner.temp }}/coverage/test/**/*.tap
${{ runner.temp }}/release/test/**/*.tap
if-no-files-found: error
- name: Make portable
if: matrix.arch != 'arm64'
run: cmake --build "%RUNNER_TEMP%/release" --target cli-portable
- name: Check portable version
if: matrix.arch != 'arm64'
shell: bash
run: '"$RUNNER_TEMP/release/portable/dokit.exe" --version'
- name: Test localisations
if: matrix.arch != 'arm64' && startsWith(matrix.qt, '6')
shell: bash
run: |
declare -Ar languages=(
[en_AU]='Australia|Unrecognised'
[en_GB]='United Kingdom|Unrecognised'
[en_US]='United States|Unrecognized'
)
for langId in "${!languages[@]}"; do
IFS='|' read -r langName localText <<< "${languages[${langId}]}"
[[ ( "${QT_VERSION}" != 6.2.* && "${QT_VERSION}" != 6.3.* ) || "${langId}" == 'en_US' ]] || {
# Prior to Qt 6.4, Qt puts the system language first, which is always en_US on GitHub hosted runners.
echo "Skipping: ${langName} (${langId}) for Qt ${QT_VERSION} on GitHub hosted Windows runner"
continue
}
echo "Checking: ${langName} (${langId})"
export QT_LOGGING_RULES='*=true'
output=$(
LANG="${langId}.UTF-8" \
"$RUNNER_TEMP/release/portable/dokit.exe" calibrate --debug --temperature x 2>&1 || :)
printf '%s\n--------\n' "${output}"
grep "Locale:.*${langName}" <<< "${output}"
grep "App translations: :/i18n/cli/${langId}\.qm" <<< "${output}"
grep "Library translations: :/i18n/lib/${langId}\.qm" <<< "${output}"
grep "${localText} temperature format" <<< "${output}"
done
env:
QT_VERSION: ${{ matrix.qt }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dokit-${{ steps.post-build.outputs.dokitVersion }}
path: |
${{ runner.temp }}/release/src/lib/${{ matrix.dll }}
${{ runner.temp }}/release/src/cli/dokit.exe
if-no-files-found: error
- name: Upload artifacts (portable)
if: matrix.arch != 'arm64'
uses: actions/upload-artifact@v4
with:
name: dokit-${{ steps.post-build.outputs.dokitVersion }}.portable
path: ${{ runner.temp }}/release/portable
if-no-files-found: error
collate-test-results:
needs: [ linux, mac, win ]
runs-on: ubuntu-24.04
env:
LCOV_VERSION: 2.3.1 # Should stay in-step, or ahead of, the Ubuntu, macOS and Windows versions.
steps:
- uses: actions/checkout@v4
- name: Install lcov
run: |
sudo apt-mark hold firefox grub-efi-amd64-signed
sudo apt update
sudo apt upgrade
sudo apt install libcapture-tiny-perl libdatetime-perl libtimedate-perl libjson-perl libperlio-gzip-perl
curl --location --silent \
"https://github.com/linux-test-project/lcov/releases/download/v${LCOV_VERSION}/lcov-${LCOV_VERSION}.tar.gz"|
tar --extract --gzip --directory "${RUNNER_TEMP}"
"${RUNNER_TEMP}/lcov-${LCOV_VERSION}/bin/lcov" --version
tee -a "${GITHUB_PATH}" <<< "${RUNNER_TEMP}/lcov-${LCOV_VERSION}/bin"
- name: Download test results
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh run download "$GITHUB_RUN_ID" --dir "$RUNNER_TEMP/artifacts" --pattern test-results-*
- name: Generate test summary
uses: pcolby/tap-summary@v1
with:
path: ${{ runner.temp }}/artifacts/**/*.tap
- name: Generate HTML coverage report
run: |
shopt -s globstar
# Update source code paths from macOS tracefiles to match Linux.
sed -i -Ee 's|^SF:/Users|SF:/home|' artifacts/*.macos-*/**/coverage.info
# Update source code paths from Windows tracefiles to match Linux, and remove all \r chars from line endings.
sed -i -Ee 's|\r$||' -e 's|\\|/|g' -e 's|^SF:[CD]:/a|SF:/home/runner/work|' artifacts/*.win*/**/coverage.info
# Combine all tracefiles into one. Note, ignoring inconsistencies between Clang and GCC reports :|
lcov --ignore-errors inconsistent $(find artifacts -name '*.info' -type f -printf '-a %p\n') -o coverage.info
# Generate the HTML report. Note, ignoring inconsistencies between Clang and GCC reports :|
genhtml --demangle-cpp --ignore-errors inconsistent --no-sort --output-directory coverage coverage.info
# Can use any of the removeHtmlDates.sh scripts here, so the Ubuntu x86-64 GCC Qt6 job's version will do.
/usr/bin/env bash ./artifacts/test-results-*.linux.24.04.x86-64.gcc.qt-6/coverage/removeHtmlDates.sh coverage
# Remove build numbers from pre-releases, and remove extra build info (such as ".linux.24.04.x86-64.gcc.qt-6")
# from all releases, since this coverage report is an aggregation of many build hosts.
sed -i -Ee 's/(headerValue">([0-9]+\.){2}[0-9]+)(((-pre)\+[0-9]+)|(\+[0-9]+))\..*</\1\5\6</' \
coverage/**/*.html
working-directory: ${{ runner.temp }}
- name: Upload HTML coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: "${{ runner.temp }}/coverage"
if-no-files-found: error
- name: Report partial-finished to Codacy
if: github.event_name == 'push' && github.actor != 'dependabot[bot]'
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
run: bash <(curl -Ls https://coverage.codacy.com/get.sh) final
- name: Report parallel-finished to Coveralls
if: github.event_name == 'push' && github.actor != 'dependabot[bot]'
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
update-tests-on-doc-branch:
permissions:
contents: write
runs-on: ubuntu-24.04
if: success() && (github.ref == 'refs/heads/main')
needs: collate-test-results
steps:
- uses: actions/checkout@v4
with: { ref: doc }
- name: Clear previous coverage report
run: rm -rf main/cov
- name: Download HTML report
uses: actions/download-artifact@v4
with:
name: coverage-report
path: main/cov
- name: Inject version selectors
run: ./.selector.sh
- name: Inspect changes # for diagnostics only.
run: git status && git diff
- name: Push updates
run: |
[[ -z $(git status --porcelain) ]] || {
git config user.name github-actions
git config user.email [email protected]
git pull
git add .
git commit -m "Update coverage report for ${GITHUB_SHA}"
git push
}