diff --git a/.github/dependabot.yml b/.github/dependabot.yaml similarity index 100% rename from .github/dependabot.yml rename to .github/dependabot.yaml diff --git a/.github/labeler.yaml b/.github/labeler.yaml index 76730d7dc..2e73a8077 100644 --- a/.github/labeler.yaml +++ b/.github/labeler.yaml @@ -1,17 +1,17 @@ api: - changed-files: - - any-glob-to-any-file: 'include/**' + - any-glob-to-any-file: 'include/**' cmake: - changed-files: - - any-glob-to-any-file: '**/CMakeLists.txt' + - any-glob-to-any-file: '**/CMakeLists.txt' lib: - changed-files: - - any-glob-to-any-file: - - 'include/**' - - 'src/lib/**' + - any-glob-to-any-file: + - 'include/**' + - 'src/lib/**' tests: - changed-files: - - any-glob-to-any-file: 'test/**' + - any-glob-to-any-file: 'test/**' diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 09fb668fe..bedb21b7d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,6 +1,6 @@ name: Build and Test -on: [push, pull_request] +on: [ push, pull_request ] permissions: contents: read @@ -12,126 +12,136 @@ jobs: 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.0 + - 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.0 env: - - { cc: clang, cxx: clang++, coverage: false } - - { cc: gcc, cxx: g++, coverage: false } - - { cc: gcc, cxx: g++, coverage: true } + - { cc: clang, cxx: clang++, coverage: false } + - { cc: gcc, cxx: g++, coverage: false } + - { cc: gcc, cxx: g++, coverage: true } steps: - - name: Upgrade OS - run: | - sudo apt-mark hold grub-efi-amd64-signed - sudo apt update && sudo apt upgrade - sudo apt install lcov libfuse2 - - 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},doc-dev},connectivity-{dev,doc-html},l10n-tools,tools-dev{,-tools}} - - 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' || '' }} - - 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 - - uses: actions/checkout@v4 - - 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: | - [[ '${{ matrix.qt }}' =~ ^[56]$ ]] || qtInstallDocs="$RUNNER_WORKSPACE/Qt/Docs/Qt-${QT_VERSION:-${{ matrix.qt }}}" - cmake -D CMAKE_BUILD_TYPE=Release \ - -D ENABLE_COVERAGE=${{ matrix.env.coverage }} \ - ${qtInstallDocs:+-D "QT_INSTALL_DOCS=$qtInstallDocs"} \ - -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 + - name: Upgrade OS + run: | + sudo apt-mark hold grub-efi-amd64-signed + sudo apt update && sudo apt upgrade + sudo apt install lcov libfuse2 + - 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},doc-dev},connectivity-{dev,doc-html},l10n-tools,tools-dev{,-tools}} + - 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' || '' }} + - 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 + env: + BASE_URL: https://github.com/linuxdeploy/linuxdeploy + run: | + curl --create-dirs --location --output-dir /home/runner/.local/bin --remote-name-all \ + "${BASE_URL}/releases/download/continuous/linuxdeploy-x86_64.AppImage" \ + "${BASE_URL}-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage" \ + "${BASE_URL}-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 + - uses: actions/checkout@v4 + - 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: | + [[ '${{ matrix.qt }}' =~ ^[56]$ ]] || + qtInstallDocs="$RUNNER_WORKSPACE/Qt/Docs/Qt-${QT_VERSION:-${{ matrix.qt }}}" + cmake -D CMAKE_BUILD_TYPE=Release \ + -D ENABLE_COVERAGE=${{ matrix.env.coverage }} \ + ${qtInstallDocs:+-D "QT_INSTALL_DOCS=$qtInstallDocs"} \ + -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 }} @@ -140,25 +150,25 @@ jobs: 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.0 + - 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.0 os: [ 'macos-13', 'macos-14', 'macos-15' ] env: - - { cc: clang, cxx: clang++, coverage: false } - - { cc: gcc-14, cxx: g++-14, coverage: false } - - { cc: gcc-14, cxx: g++-14, coverage: true } + - { cc: clang, cxx: clang++, coverage: false } + - { cc: gcc-14, cxx: g++-14, coverage: false } + - { cc: gcc-14, cxx: g++-14, coverage: true } 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. @@ -204,92 +214,99 @@ jobs: - { qt: '6.7.3', env: { cc: gcc-14 } } - { qt: '6.8.0', env: { cc: gcc-14 } } steps: - - uses: actions/checkout@v4 - - name: Install lcov - run: brew install 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' || '' }} - - 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: Choose target architectures - id: arch - run: | - # Qt only supports x86-64 (not arm64) on macOS 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.env.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: Build - id: build - env: - CC: ${{ matrix.env.cc }} - CXX: ${{ matrix.env.cxx }} - PROJECT_BUILD_ID: ${{ github.run_number }}.${{ matrix.os }}.${{ steps.arch.outputs.buildId }}.${{ 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-14' || '/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 - timeout-minutes: 1 - - 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 + - uses: actions/checkout@v4 + - name: Install lcov + run: brew install 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' || '' }} + - 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: 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.env.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: Build + id: build + env: + CC: ${{ matrix.env.cc }} + CXX: ${{ matrix.env.cxx }} + PROJECT_BUILD_ID: "${{ github.run_number }}.${{ matrix.os }}.${{ steps.arch.outputs.buildId }}.\ + ${{ 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-14' || '/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 + timeout-minutes: 1 + - 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 @@ -298,241 +315,249 @@ jobs: 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.0 + - 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.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' } - - { arch: arm64, qt: '6.8.0' } # \todo 6.8.0 Beta1 removes cross-compiling to ARM support. - # 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.3' } - - { arch: x86, qt: '6.8.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' } + # 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' } + - { arch: arm64, qt: '6.8.0' } # \todo 6.8.0 Beta1 removes cross-compiling to ARM support. + # 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.3' } + - { arch: x86, qt: '6.8.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.3', qtArch: win64_mingw } - - { generator: 'MinGW Makefiles', qt: '6.8.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 } - # \todo Remove this one when https://github.com/jurplel/install-qt-action/issues/250 is resovled. - - { generator: 'NMake Makefiles', arch: x86-64, qt: '6.8.0', qtArch: win64_msvc2022_64 } - # 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 } + - { 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.3', qtArch: win64_mingw } + - { generator: 'MinGW Makefiles', qt: '6.8.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 } + # \todo Remove this one when https://github.com/jurplel/install-qt-action/issues/250 is resovled. + - { generator: 'NMake Makefiles', arch: x86-64, qt: '6.8.0', qtArch: win64_msvc2022_64 } + # 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@v4 - with: - version: ${{ matrix.qt }} - arch: win64_msvc2019_64 - set-env: false - - 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@v4 - 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.qt, '6.8' )) && startsWith(matrix.generator, 'MinGW') && 'tools_mingw90' || '' }} - 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' || '' }} - - 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=${QT_ROOT_DIR/_64/_arm64/}\lib\cmake\Qt6\qt.toolchain.cmake" >> $GITHUB_ENV - echo "qtHostPath=${QT_ROOT_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: | - 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 + - 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: win64_msvc2019_64 + set-env: false + - 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@v4 + 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.qt, '6.8' )) && + startsWith(matrix.generator, 'MinGW') && 'tools_mingw90' || '' }} + 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' || '' }} + - 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=${QT_ROOT_DIR/_64/_arm64/}\lib\cmake\Qt6\qt.toolchain.cmake" >> $GITHUB_ENV + echo "qtHostPath=${QT_ROOT_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 w/ Qt5. + - name: Build + env: + PROJECT_BUILD_ID: ${{ github.run_number }}.win.${{ matrix.arch }}.${{ matrix.tool }}.qt-${{ matrix.qt }} + run: | + 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: [ linux, mac, win ] runs-on: ubuntu-24.04 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 Ubuntu GCC Qt6 job's version will do. - /usr/bin/env bash ./artifacts/test-results-*-cov.qt-6/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]+))\..*> ~/.lcovrc + genhtml --output-directory coverage coverage.info + # Can use any of the removeHtmlDates.sh scripts here, so the Ubuntu GCC Qt6 job's version will do. + /usr/bin/env bash ./artifacts/test-results-*-cov.qt-6/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]+))\..* "$RUNNER_TEMP/cppcheck.xml" - - name: Generate Report - if: ${{ failure() }} - run: | - cppcheck-htmlreport --title=Dokit --file="$RUNNER_TEMP/cppcheck.xml" \ - --report-dir="$RUNNER_TEMP/report" --source-dir="$GITHUB_WORKSPACE" - - name: Upload Report - if: ${{ failure() }} - uses: actions/upload-artifact@v4 - with: - name: Cppcheck HTML Report - path: "${{ runner.temp }}/report" + - name: Install Cppcheck + run: | + sudo apt-mark hold grub-efi-amd64-signed + sudo apt update + sudo apt upgrade + sudo apt install cppcheck + - uses: actions/checkout@v4 + - name: Perform Cppcheck Analysis + run: ./.cppcheck.sh --xml --xml-version=2 2> "$RUNNER_TEMP/cppcheck.xml" + - name: Generate Report + if: ${{ failure() }} + run: | + cppcheck-htmlreport --title=Dokit --file="$RUNNER_TEMP/cppcheck.xml" \ + --report-dir="$RUNNER_TEMP/report" --source-dir="$GITHUB_WORKSPACE" + - name: Upload Report + if: ${{ failure() }} + uses: actions/upload-artifact@v4 + with: + name: Cppcheck HTML Report + path: "${{ runner.temp }}/report" + + yamllint: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - run: yamllint . diff --git a/.yamllint b/.yamllint new file mode 100644 index 000000000..01b5d5b57 --- /dev/null +++ b/.yamllint @@ -0,0 +1,24 @@ +extends: default + +ignore: /doc/doxygen-awesome-css + +rules: + braces: + max-spaces-inside: 1 + min-spaces-inside: 1 + brackets: + max-spaces-inside: 1 + min-spaces-inside: 1 + commas: + max-spaces-after: -1 + comments: + min-spaces-from-content: 1 + document-start: disable + indentation: + check-multi-line-strings: false + indent-sequences: true + spaces: 2 + line-length: + max: 120 + truthy: + check-keys: false