Skip to content

Differentiate some uploaded artifacts #1009

Differentiate some uploaded artifacts

Differentiate some uploaded artifacts #1009

Workflow file for this run

name: Build and Test
on: [push, pull_request]
jobs:
linux0:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
env:
- { cc: clang, cxx: clang++, coverage: false }
- { cc: gcc, cxx: g++, coverage: false }
- { cc: gcc, cxx: g++, coverage: true }
steps:
- uses: actions/checkout@v4
- name: Install Qt
run: |
sudo apt-mark hold grub-efi-amd64-signed
sudo apt update
sudo apt upgrade
sudo apt install lcov libfuse2 qtbase5-dev qtbase5-doc-dev qtconnectivity5-dev qtconnectivity5-doc-html qttools5-dev qttools5-dev-tools
- name: Install linuxdeploy
run: |
curl --create-dirs --location --output-dir /home/runner/.local/bin --remote-name-all \
'https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage' \
'https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage' \
'https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage'
chmod a+x /home/runner/.local/bin/linuxdeploy{,-plugin-{appimage,qt}}-x86_64.AppImage
- name: Build
id: build
env:
CC: ${{ matrix.env.cc }}
CXX: ${{ matrix.env.cxx }}
PROJECT_BUILD_ID: ${{ github.run_number }}.linux.x86-64.${{ matrix.env.cc }}${{ matrix.env.coverage && '-cov' || '' }}
run: |
cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_COVERAGE=${{ matrix.env.coverage }} -S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP"
echo "dokitVersion=$(cat "$RUNNER_TEMP/version.txt")" | tee -a "$GITHUB_OUTPUT"
{ echo -n 'tap='; [[ '${{ matrix.qt }}' =~ ^5\.1[2-9]|6 ]] && echo true || echo false; } | tee -a "$GITHUB_OUTPUT"
cmake --build "$RUNNER_TEMP"
"$RUNNER_TEMP/src/cli/dokit" --version
- name: Test
run: ctest --output-on-failure --test-dir "$RUNNER_TEMP" --verbose
- name: Collate test coverage
if: matrix.env.coverage
run: cmake --build "$RUNNER_TEMP" --target coverage
- name: Upload test results
if: matrix.env.coverage || fromJSON(steps.build.outputs.tap)
uses: actions/upload-artifact@v4
with:
name: test-results-${{ steps.build.outputs.dokitVersion }}
path: |
${{ runner.temp }}/coverage.info
${{ runner.temp }}/removeHtmlDates.sh
${{ runner.temp }}/test/**/*.tap
if-no-files-found: error
- name: Report parallel coverage to Codacy
if: matrix.env.coverage && 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.info"
- name: Report parallel coverage to Coveralls
if: matrix.env.coverage && github.event_name == 'push' && github.actor != 'dependabot[bot]'
uses: coverallsapp/github-action@v2
with:
file: ${{ runner.temp }}/coverage.info
format: lcov
flag-name: linux0-${{ matrix.env.cc }}
parallel: true
- name: Build AppImage
run: cmake --build "$RUNNER_TEMP" --target cli-appimage
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dokit-${{ steps.build.outputs.dokitVersion }}
path: |
${{ runner.temp }}/src/lib/libQtPokit.so
${{ runner.temp }}/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 }}/dokit-${{ steps.build.outputs.dokitVersion }}.AppImage
if-no-files-found: error
linux:
runs-on: ubuntu-latest
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.0' ]
env:
- { cc: clang, cxx: clang++, coverage: false }
- { cc: gcc, cxx: g++, coverage: false }
- { cc: gcc, cxx: g++, coverage: true }
steps:
- uses: actions/checkout@v4
- name: Install Tools
run: |
sudo apt-mark hold grub-efi-amd64-signed
sudo apt update
sudo apt upgrade
sudo apt install clang lcov libfuse2
- uses: actions/setup-python@v5
with:
python-version: '>=3.9'
- name: Install Qt
uses: jurplel/install-qt-action@v3
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.1.*
- name: Upload aqtinstall log file
if: failure()
uses: actions/upload-artifact@v4
with:
name: aqtinstall-log-linux-${{ matrix.env.cc }}-${{ matrix.qt }}${{ matrix.env.coverage && '-cov' || ''}}
path: aqtinstall.log
if-no-files-found: error
- name: Install linuxdeploy
run: |
curl --create-dirs --location --output-dir /home/runner/.local/bin --remote-name-all \
'https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage' \
'https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage' \
'https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage'
chmod a+x /home/runner/.local/bin/linuxdeploy{,-plugin-{appimage,qt}}-x86_64.AppImage
- name: Build
id: build
env:
CC: ${{ matrix.env.cc }}
CXX: ${{ matrix.env.cxx }}
PROJECT_BUILD_ID: ${{ github.run_number }}.linux.x86-64.${{ matrix.env.cc }}${{ matrix.env.coverage && '-cov' || '' }}.qt-${{ matrix.qt }}
run: |
cmake -D CMAKE_BUILD_TYPE=Release \
-D ENABLE_COVERAGE=${{ matrix.env.coverage }} \
-D QT_INSTALL_DOCS="$RUNNER_WORKSPACE/Qt/Docs/Qt-${{ matrix.qt }}" \
-S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP"
echo "dokitVersion=$(cat "$RUNNER_TEMP/version.txt")" | tee -a "$GITHUB_OUTPUT"
{ echo -n 'tap='; [[ '${{ matrix.qt }}' =~ ^5\.1[2-9]|6 ]] && echo true || echo false; } | tee -a "$GITHUB_OUTPUT"
cmake --build "$RUNNER_TEMP"
"$RUNNER_TEMP/src/cli/dokit" --version
- name: Test
run: ctest --output-on-failure --test-dir "$RUNNER_TEMP" --verbose
- name: Collate test coverage
if: matrix.env.coverage
run: cmake --build "$RUNNER_TEMP" --target coverage
- name: Upload test results
if: matrix.env.coverage || fromJSON(steps.build.outputs.tap)
uses: actions/upload-artifact@v4
with:
name: test-results-${{ steps.build.outputs.dokitVersion }}
path: |
${{ runner.temp }}/coverage.info
${{ runner.temp }}/removeHtmlDates.sh
${{ runner.temp }}/test/**/*.tap
if-no-files-found: error
- name: Report parallel coverage to Codacy
if: matrix.env.coverage && 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.info"
- name: Report parallel coverage to Coveralls
if: matrix.env.coverage && github.event_name == 'push' && github.actor != 'dependabot[bot]'
uses: coverallsapp/github-action@v2
with:
file: ${{ runner.temp }}/coverage.info
format: lcov
flag-name: linux-${{ matrix.env.cc }}-${{ matrix.qt }}
parallel: true
- name: Build AppImage
run: cmake --build "$RUNNER_TEMP" --target cli-appimage
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dokit-${{ steps.build.outputs.dokitVersion }}
path: |
${{ runner.temp }}/src/lib/libQtPokit.so
${{ runner.temp }}/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 }}/dokit-${{ steps.build.outputs.dokitVersion }}.AppImage
if-no-files-found: error
mac:
runs-on: ${{ matrix.os }}
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.0' ]
os: [ 'macos-12', 'macos-13', 'macos-14' ]
env:
- { cc: clang, cxx: clang++, coverage: false }
- { cc: gcc-12, cxx: g++-12, coverage: false }
- { cc: gcc-12, cxx: g++-12, coverage: true }
exclude:
# Exclude Qt 5.x with GCC on macOS 13 (Qt5 only officially supports up to macOS 12).
- { qt: '5.9.9', os: 'macos-13', env: { cc: gcc-12 } }
- { qt: '5.10.1', os: 'macos-13', env: { cc: gcc-12 } }
- { qt: '5.11.3', os: 'macos-13', env: { cc: gcc-12 } }
- { qt: '5.12.12', os: 'macos-13', env: { cc: gcc-12 } }
- { qt: '5.13.2', os: 'macos-13', env: { cc: gcc-12 } }
- { qt: '5.14.2', os: 'macos-13', env: { cc: gcc-12 } }
- { qt: '5.15.2', os: 'macos-13', env: { cc: gcc-12 } }
# Exclude Qt 5.x on macOS 14+ (Qt5 only officially supports up to macOS 12).
- { qt: '5.9.9', os: 'macos-14' }
- { qt: '5.10.1', os: 'macos-14' }
- { qt: '5.11.3', os: 'macos-14' }
- { qt: '5.12.12', os: 'macos-14' }
- { qt: '5.13.2', os: 'macos-14' }
- { qt: '5.14.2', os: 'macos-14' }
- { qt: '5.15.2', os: 'macos-14' }
# Exclude Qt 6.2 on macOS 14+ (Qt6 only officially supports macOS 14 from Qt 6.4+, and some 6.2.n LTS update).
- { qt: '6.2.4', os: 'macos-14' }
# Exclude Qt 5.10 with GCC on macOS. See https://bugreports.qt.io/browse/QTBUG-66585
- { qt: '5.10.1', env: { cc: gcc-12 } }
# Exclude Qt6 with GCC on macOS for now, as GCC (only) has lots of false compiler
# errors, that even if worked-around result in SIGBUS errors in unit tests. See
# https://bugreports.qt.io/browse/QTBUG-107050 (non-exhaustive).
- { qt: '6.2.4', env: { cc: gcc-12 } }
- { qt: '6.3.2', env: { cc: gcc-12 } }
- { qt: '6.4.3', env: { cc: gcc-12 } }
- { qt: '6.5.3', env: { cc: gcc-12 } }
- { qt: '6.6.3', env: { cc: gcc-12 } }
steps:
- uses: actions/checkout@v4
- name: Install lcov
run: brew install lcov
- name: Install Qt
uses: jurplel/install-qt-action@v3
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.1.*
- name: Upload aqtinstall log file
if: failure()
uses: actions/upload-artifact@v4
with:
name: aqtinstall-log-${{ matrix.os }}-${{ matrix.env.cc }}-${{ matrix.qt }}${{ matrix.env.coverage && '-cov' || ''}}
path: aqtinstall.log
if-no-files-found: error
- name: Build
id: build
env:
CC: ${{ matrix.env.cc }}
CXX: ${{ matrix.env.cxx }}
CMAKE_OSX_ARCHITECTURES: ${{ startsWith(matrix.qt, '6') && 'arm64;' || '' }}x86_64
PROJECT_BUILD_ID: ${{ github.run_number }}.${{ matrix.os }}.${{ startsWith(matrix.qt, '6') && 'arm64-' || '' }}x86_64.${{ matrix.env.cc }}${{ matrix.env.coverage && '-cov' || '' }}.qt-${{ matrix.qt }}
run: |
cmake -D CMAKE_BUILD_TYPE=Release \
-D CODECOV_GCOV=${{ startsWith(matrix.env.cc, 'gcc') && '/usr/local/bin/gcov-12' || '/usr/bin/gcov'}} \
-D ENABLE_COVERAGE=${{ matrix.env.coverage }} \
-D QT_INSTALL_DOCS="$RUNNER_WORKSPACE/Qt/Docs/Qt-${{ matrix.qt }}" \
-S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP"
echo "dokitVersion=$(cat "$RUNNER_TEMP/version.txt")" | tee -a "$GITHUB_OUTPUT"
{ echo -n 'tap='; [[ '${{ matrix.qt }}' =~ ^5\.1[2-9]|6 ]] && echo true || echo false; } | tee -a "$GITHUB_OUTPUT"
cmake --build "$RUNNER_TEMP" -- VERBOSE=1
find "$RUNNER_TEMP" -name 'Info.plist'
find "$RUNNER_TEMP" -name 'Info.plist' -execdir cat '{}' \;
"$RUNNER_TEMP/src/cli/dokit.app/Contents/MacOS/dokit" --version
- name: Test
run: ctest --output-on-failure --test-dir "$RUNNER_TEMP" --verbose
- name: Collate test coverage
if: matrix.env.coverage
run: cmake --build "$RUNNER_TEMP" --target coverage
- name: Upload test results
if: matrix.env.coverage || fromJSON(steps.build.outputs.tap)
uses: actions/upload-artifact@v4
with:
name: test-results-${{ steps.build.outputs.dokitVersion }}
path: |
${{ runner.temp }}/coverage.info
${{ runner.temp }}/removeHtmlDates.sh
${{ runner.temp }}/test/**/*.tap
if-no-files-found: error
- name: Report parallel coverage to Codacy
if: matrix.env.coverage && 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.info"
- name: Report parallel coverage to Coveralls
if: matrix.env.coverage && github.event_name == 'push' && github.actor != 'dependabot[bot]'
uses: coverallsapp/github-action@v2
with:
file: ${{ runner.temp }}/coverage.info
format: lcov
flag-name: mac-${{ matrix.env.cc }}-${{ matrix.qt }}
parallel: true
- name: Make app bundle
run: macdeployqt "$RUNNER_TEMP/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 }}/src/cli/*.app
if-no-files-found: error
win:
runs-on: windows-latest
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.0' ]
generator: [ 'MinGW Makefiles', 'NMake Makefiles' ]
arch: [ x86, x86-64, arm64 ]
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 builds for arm64, since MinGW has no arm64 support.
- { arch: arm64, generator: 'MinGW Makefiles' }
# Exclude MinGW builds for x86 (32-bit), since the GitHub Actions Windows runners only
# includes MinGW-w64, and not MinGW (32-bit).
- { arch: x86, generator: 'MinGW Makefiles' }
# Exclude x86 (32-bit) builds for Qt 5.10.1 with MSVC, for QTBUG-67259.
# See https://bugreports.qt.io/browse/QTBUG-67259
- { arch: x86, qt: '5.10.1', generator: 'NMake Makefiles' }
# Exclude x86 (32-bit) builds for Qt 6.x, since the Qt online installer doesn't provide
# those binaries for Qt6.
- { 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.0' }
# Exclude MinGW 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', generator: 'MinGW Makefiles' }
- { arch: x86-64, qt: '5.10.1', generator: 'MinGW Makefiles' }
- { arch: x86-64, qt: '5.11.3', generator: 'MinGW Makefiles' }
include: # Override default arch's for install-qt-action and msvc-dev-cmd.
- { generator: 'MinGW Makefiles', qt: '5.12.12', qtArch: win64_mingw73 }
- { generator: 'MinGW Makefiles', qt: '5.13.2', qtArch: win64_mingw73 }
- { generator: 'MinGW Makefiles', qt: '5.14.2', qtArch: win64_mingw73 }
- { generator: 'MinGW Makefiles', qt: '5.15.2', qtArch: win64_mingw81 }
- { generator: 'MinGW Makefiles', qt: '6.2.4', qtArch: win64_mingw }
- { generator: 'MinGW Makefiles', qt: '6.3.2', qtArch: win64_mingw }
- { generator: 'MinGW Makefiles', qt: '6.4.3', qtArch: win64_mingw }
- { generator: 'MinGW Makefiles', qt: '6.5.3', qtArch: win64_mingw }
- { generator: 'MinGW Makefiles', qt: '6.6.3', qtArch: win64_mingw }
- { generator: 'MinGW Makefiles', qt: '6.7.0', qtArch: win64_mingw }
- { generator: 'NMake Makefiles', arch: x86, qt: '5.9.9', qtArch: win32_msvc2015 }
- { generator: 'NMake Makefiles', arch: x86, qt: '5.11.3', qtArch: win32_msvc2015 }
- { generator: 'NMake Makefiles', arch: x86, qt: '5.12.12', qtArch: win32_msvc2017 }
- { generator: 'NMake Makefiles', arch: x86, qt: '5.13.2', qtArch: win32_msvc2017 }
- { generator: 'NMake Makefiles', arch: x86, qt: '5.14.2', qtArch: win32_msvc2017 }
- { generator: 'NMake Makefiles', arch: x86, qt: '5.15.2', qtArch: win32_msvc2019 }
- { generator: 'NMake Makefiles', arch: arm64, qtArch: win64_msvc2019_arm64 }
- { generator: 'NMake Makefiles', arch: arm64, msvcArch: amd64_arm64 }
- { generator: 'NMake Makefiles', arch: x86, msvcArch: amd64_x86 }
- { generator: 'NMake Makefiles', arch: x86-64, msvcArch: amd64 }
# Define the toolchain and dll names per generator (for artifact naming mostly).
- { generator: 'NMake Makefiles', tool: msvc, dll: QtPokit.dll }
- { generator: 'MinGW Makefiles', tool: mingw, dll: libQtPokit.dll }
steps:
- uses: actions/checkout@v4
- name: Install host Qt for cross-compilation
if: matrix.arch == 'arm64'
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt }}
arch: win64_msvc2019_64
set-env: false
aqtversion: ==3.1.*
- name: Upload aqtinstall log file
if: matrix.arch == 'arm64' && failure()
uses: actions/upload-artifact@v4
with:
name: aqtinstall-log-win-${{ matrix.arch }}-${{ startsWith(matrix.generator, 'MinGW') && 'mingw' || 'msvc' }}-${{ matrix.qt }}-cross
path: aqtinstall.log
if-no-files-found: error
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt }}
modules: ${{ startsWith(matrix.qt, '6') && 'qtconnectivity' || '' }}
arch: ${{ matrix.qtArch }}
# Use Qt's shipped MinGW for Qt 6.6+ for now, as the runner's MinGW version crashes with Qt 6.6 and 6.7.
# \todo Remove this if/when the runner's MinGW is updated to fix the incompatibility.
tools: ${{ (startsWith(matrix.qt, '6.6') || startsWith(matrix.qt, '6.7')) && startsWith(matrix.generator, 'MinGW') && 'tools_mingw90' || '' }}
#add-tools-to-path: true ///< \toto Use once released by install-qt-action.
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.1.*
- name: Upload aqtinstall log file
if: failure()
uses: actions/upload-artifact@v4
with:
name: aqtinstall-log-win-${{ matrix.arch }}-${{ startsWith(matrix.generator, 'MinGW') && 'mingw' || 'msvc' }}-${{ matrix.qt }}
path: aqtinstall.log
if-no-files-found: error
- name: Configure cross-compilation
if: matrix.arch == 'arm64'
shell: bash
run: |
echo "CMAKE_TOOLCHAIN_FILE=${Qt6_DIR/_64/_arm64/}\lib\cmake\Qt6\qt.toolchain.cmake" >> $GITHUB_ENV
echo "qtHostPath=${Qt6_DIR/_arm64/_64}" >> $GITHUB_ENV
- name: Configure MSVC
if: ${{ contains(matrix.generator, 'nmake') }}
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.msvcArch }}
toolset: ${{ startsWith(matrix.qt, '5') && '14.29' || '' }} # MSVC 14.38+ has many deprecation issues with Qt5.
- name: Build
env:
PROJECT_BUILD_ID: ${{ github.run_number }}.win.${{ matrix.arch }}.${{ matrix.tool }}.qt-${{ matrix.qt }}
run: |
:: \todo Remove this when either the runner's MinGW is upgraded, or add-tools-to-path is released by install-qt-action.
if exist "%GITHUB_WORKSPACE%\..\Qt\Tools\mingw1120_64" set "PATH=%GITHUB_WORKSPACE%\..\Qt\Tools\mingw1120_64\bin\;%PATH%"
cmake -D CMAKE_BUILD_TYPE=Release ^
-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%"
cmake --build "%RUNNER_TEMP%"
- name: Capture build-output variables
id: post-build
shell: bash
run: |
echo "dokitVersion=$(cat "$RUNNER_TEMP/version.txt")" | tee -a "$GITHUB_OUTPUT"
{ echo -n 'tap='; [[ '${{ matrix.qt }}' =~ ^5\.1[2-9]|6 ]] && echo true || echo false; } | tee -a "$GITHUB_OUTPUT"
- name: Install DLL for tests
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 }}
- name: Test # We can't execute arm64 binaries on an x86-64 host.
if: matrix.arch != 'arm64'
run: ctest --output-on-failure --test-dir "%RUNNER_TEMP%" --verbose
- name: Upload test results
if: matrix.arch != 'arm64' && fromJSON(steps.post-build.outputs.tap)
uses: actions/upload-artifact@v4
with:
name: test-results-${{ steps.post-build.outputs.dokitVersion }}
path: ${{ runner.temp }}/test/**/*.tap
if-no-files-found: error
- name: Make portable
if: matrix.arch != 'arm64'
run: |
mkdir portable
copy /v /b src\lib\${{ matrix.dll }} /b portable
copy /v /b src\cli\dokit.exe /b portable
cd portable
windeployqt --compiler-runtime --release --verbose 2 dokit.exe ${{ matrix.dll }}
:: dokit.exe --version # This would hang the job, because Qt will show a message box.
working-directory: ${{ runner.temp }}
- name: Check portable version
if: matrix.arch != 'arm64'
shell: bash
run: '"$RUNNER_TEMP/portable/dokit.exe" --version'
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dokit-${{ steps.post-build.outputs.dokitVersion }}
path: |
${{ runner.temp }}/src/lib/${{ matrix.dll }}
${{ runner.temp }}/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 }}/portable
if-no-files-found: error
collate-test-results:
needs: [ linux0, linux, mac, win ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install lcov
run: |
sudo apt-mark hold grub-efi-amd64-signed
sudo apt update
sudo apt upgrade
sudo apt install lcov
- name: Download test results
env:
GITHUB_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/**/coverage.info
# Combine all tracefiles into one.
lcov $(find artifacts -name '*.info' -type f -printf '-a %p\n') -o coverage.info
# Generate the HTML report.
echo 'genhtml_sort = 0' >> ~/.lcovrc
genhtml --output-directory coverage coverage.info
# Can use any of the removeHtmlDates.sh scripts here, so the linux0 job's version will do.
/usr/bin/env bash ./artifacts/test-results-*-cov/removeHtmlDates.sh
# Remove build numbers from pre-releases, and remove extra build info (such as ".linux.x86-64.gcc-cov")
# 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:
runs-on: ubuntu-latest
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: 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
}