Skip to content

Commit

Permalink
Combine the linux and linux0 workflows
Browse files Browse the repository at this point in the history
And build for both Ubuntu's Qt5 and Qt6 versions.

Squashed commit of the following:

commit 01bd06d
Author: Paul Colby <git@colby.id.au>
Date:   Mon May 6 09:12:37 2024 +1000

    Re-instate the macOS and Windows builds

commit 7f41952
Author: Paul Colby <git@colby.id.au>
Date:   Mon May 6 09:00:46 2024 +1000

    Remove references to the deleted `linux0` job

commit 30dff4a
Author: Paul Colby <git@colby.id.au>
Date:   Mon May 6 08:49:33 2024 +1000

    Add a couple more \todo comments re Ubuntu 22.04 workarounds

commit 969cdd7
Author: Paul Colby <git@colby.id.au>
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 53e462f
Author: Paul Colby <git@colby.id.au>
Date:   Sun May 5 18:06:26 2024 +1000

    Use the correct matrix variable

commit 9b4a784
Author: Paul Colby <git@colby.id.au>
Date:   Sun May 5 16:16:59 2024 +1000

    Correct GitHub Actions syntax

commit ab91665
Author: Paul Colby <git@colby.id.au>
Date:   Sun May 5 15:40:43 2024 +1000

    Remove misplaced `echo` command

commit acf5a9c
Author: Paul Colby <git@colby.id.au>
Date:   Sun May 5 15:36:24 2024 +1000

    Use sudo for `apt install`

commit 8de60b7
Author: Paul Colby <git@colby.id.au>
Date:   Sun May 5 15:27:46 2024 +1000

    Fold Ubuntu's Qt5 anf Qt6 builds into the one Linux job

commit daa28f1
Author: Paul Colby <git@colby.id.au>
Date:   Sun May 5 13:41:07 2024 +1000

    Use full path for Ubuntu 22.04 (not needed for 23+)

commit c33a90f
Author: Paul Colby <git@colby.id.au>
Date:   Sun May 5 13:36:55 2024 +1000

    Install the qtpaths6 binary

commit 6520600
Author: Paul Colby <git@colby.id.au>
Date:   Sun May 5 13:30:48 2024 +1000

    Install just the Qt docs via aqt

commit 75ee827
Author: Paul Colby <git@colby.id.au>
Date:   Sun May 5 13:18:56 2024 +1000

    Keep the qt6-tools-dev-tools package for Qt6

commit 242cec7
Author: Paul Colby <git@colby.id.au>
Date:   Sun May 5 13:11:46 2024 +1000

    Install qt6-l10n-tools for Ubuntu 22.04
  • Loading branch information
pcolby committed May 6, 2024
1 parent 1919339 commit 7980484
Showing 1 changed file with 46 additions and 94 deletions.
140 changes: 46 additions & 94 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -119,16 +71,18 @@ 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:
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 }}' == '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"
Expand Down Expand Up @@ -180,7 +134,6 @@ jobs:
if-no-files-found: error

mac:
if: false
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -290,7 +243,6 @@ jobs:
if-no-files-found: error

win:
if: false
runs-on: windows-latest
defaults: { run: { shell: cmd } }
strategy:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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]+))\..*</\1\5\6</' coverage/**/*.html
Expand Down

0 comments on commit 7980484

Please sign in to comment.