From 7980484a1ff37a3256e4eeb9d5726af5c0c566c6 Mon Sep 17 00:00:00 2001 From: Paul Colby Date: Mon, 6 May 2024 10:19:50 +1000 Subject: [PATCH] Combine the `linux` and `linux0` workflows And build for both Ubuntu's Qt5 and Qt6 versions. Squashed commit of the following: commit 01bd06dc5dce5aa164599e6bc0cbf4354b36430f Author: Paul Colby Date: Mon May 6 09:12:37 2024 +1000 Re-instate the macOS and Windows builds commit 7f419529abc83c24fa3156682539743f66b5249b Author: Paul Colby Date: Mon May 6 09:00:46 2024 +1000 Remove references to the deleted `linux0` job commit 30dff4a9a924157c6ca80a6267fa186bd34a2cbc Author: Paul Colby Date: Mon May 6 08:49:33 2024 +1000 Add a couple more \todo comments re Ubuntu 22.04 workarounds commit 969cdd74687273e7daf9d951ca1951c07a6b5570 Author: Paul Colby Date: Sun May 5 18:10:56 2024 +1000 Remove the superseded `linux0` job That job how now been incorporated into the `linux` job. commit 53e462f554a4d2211d624a07fb5db110847267f3 Author: Paul Colby Date: Sun May 5 18:06:26 2024 +1000 Use the correct matrix variable commit 9b4a7840c8d5816165747ebfbe25a40c9634662e Author: Paul Colby Date: Sun May 5 16:16:59 2024 +1000 Correct GitHub Actions syntax commit ab916655c1cbecc8fe6549886ef21572f9f9c958 Author: Paul Colby Date: Sun May 5 15:40:43 2024 +1000 Remove misplaced `echo` command commit acf5a9cd16d21ba07447d65d0723b7181cb0f642 Author: Paul Colby Date: Sun May 5 15:36:24 2024 +1000 Use sudo for `apt install` commit 8de60b70dea06fb295f6a0d9acfa6963e8eb5ff0 Author: Paul Colby Date: Sun May 5 15:27:46 2024 +1000 Fold Ubuntu's Qt5 anf Qt6 builds into the one Linux job commit daa28f1c71e79ddf400ae2c8cf4a8f3eac2e8742 Author: Paul Colby Date: Sun May 5 13:41:07 2024 +1000 Use full path for Ubuntu 22.04 (not needed for 23+) commit c33a90f261cce4f376255a92c3643e7d5d1c6dcd Author: Paul Colby Date: Sun May 5 13:36:55 2024 +1000 Install the qtpaths6 binary commit 6520600d8412610d8f103d2db0ba3ff41ab48637 Author: Paul Colby Date: Sun May 5 13:30:48 2024 +1000 Install just the Qt docs via aqt commit 75ee8278eefcd26822749db1915c9e258aa7a044 Author: Paul Colby Date: Sun May 5 13:18:56 2024 +1000 Keep the qt6-tools-dev-tools package for Qt6 commit 242cec7a0063970ab33264b3335e780b8f1c6ff7 Author: Paul Colby Date: Sun May 5 13:11:46 2024 +1000 Install qt6-l10n-tools for Ubuntu 22.04 --- .github/workflows/build.yaml | 140 ++++++++++++----------------------- 1 file changed, 46 insertions(+), 94 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7fec077f3..cc3c19068 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -3,107 +3,59 @@ name: Build and Test on: [push, pull_request] jobs: - linux0: + linux: runs-on: ubuntu-latest 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 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 + - name: Upgrade OS run: | sudo apt-mark hold grub-efi-amd64-signed - sudo apt update - sudo apt upgrade - sudo apt install lcov libfuse2 qt6-base-dev qt6-connectivity-dev qt6-tools-dev qt6-tools-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' || '' }} + sudo apt update && sudo apt upgrade + sudo apt install lcov libfuse2 + - 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: | - 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 + # \todo Add the Qt6 doc packages here when GitHub ugrades to Ubuntu 23.x+ + sudo apt install qt6-{base-dev{,-tools},connectivity-dev,l10n-tools,tools-dev{,-tools}} + # \todo Remove this QT_VERSION env var when GitHub ugrades to Ubuntu 23.x+ + echo "QT_VERSION=$(/usr/lib/qt6/bin/qtpaths6 --qt-query QT_VERSION)" | tee "$GITHUB_ENV" + - name: Install Qt docs + # \todo Remove this step when GitHub updates their Ubuntu image. This is only required for Ubuntu 22.04, since + # that release is missing the Qt6 documentation packages. Can also remove the above QT_VERSION env var then too. + if: matrix.qt == 6 + uses: jurplel/install-qt-action@v3 with: - name: dokit-${{ steps.build.outputs.dokitVersion }}.AppImage - path: ${{ runner.temp }}/dokit-${{ steps.build.outputs.dokitVersion }}.AppImage - if-no-files-found: error - - linux: - if: false - 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' ] - 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 - - name: Install Qt + version: ${{ env.QT_VERSION }} + no-qt-binaries: true + documentation: true + doc-archives: 'qtcore' + doc-modules: 'qtbluetooth' + - name: Install online Qt version + if: contains(matrix.qt, '.') # ie if not using Ubuntu's Qt5/Qt6. uses: jurplel/install-qt-action@v3 with: version: ${{ matrix.qt }} @@ -119,6 +71,7 @@ jobs: '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: @@ -126,9 +79,10 @@ jobs: 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 }}' == '5' ]] || qtInstallDocs="$RUNNER_WORKSPACE/Qt/Docs/Qt-${QT_VERSION:-${{ matrix.qt }}}" cmake -D CMAKE_BUILD_TYPE=Release \ -D ENABLE_COVERAGE=${{ matrix.env.coverage }} \ - -D QT_INSTALL_DOCS="$RUNNER_WORKSPACE/Qt/Docs/Qt-${{ matrix.qt }}" \ + ${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" @@ -180,7 +134,6 @@ jobs: if-no-files-found: error mac: - if: false runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -290,7 +243,6 @@ jobs: if-no-files-found: error win: - if: false runs-on: windows-latest defaults: { run: { shell: cmd } } strategy: @@ -451,7 +403,7 @@ jobs: if-no-files-found: error collate-test-results: - needs: [ linux0, linux, mac, win ] + needs: [ linux, mac, win ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -479,8 +431,8 @@ jobs: # 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 + # 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]+))\..*