From 2f2c187f181613c9d165f1487ba7a0c40200d471 Mon Sep 17 00:00:00 2001 From: pajlada Date: Sat, 24 Jun 2023 23:48:29 +0200 Subject: [PATCH] Run tests on Qt 5.12.12 & Qt 6.2.4 in CI (#4703) --- .github/workflows/test.yml | 41 +++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 610cdf29c..4a1d85e80 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,8 +18,13 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04] - qt-version: [5.15.2] + include: + - os: "ubuntu-20.04" + qt-version: "5.15.2" + - os: "ubuntu-20.04" + qt-version: "5.12.12" + - os: "ubuntu-22.04" + qt-version: "6.2.4" fail-fast: false steps: @@ -27,20 +32,28 @@ jobs: with: submodules: recursive - - name: Cache Qt - id: cache-qt - uses: actions/cache@v3 - with: - path: "${{ github.workspace }}/qt/" - key: ${{ runner.os }}-QtCache-${{ matrix.qt-version }} + - name: Set BUILD_WITH_QT6 + if: startsWith(matrix.qt-version, '6.') + run: | + echo "C2_BUILD_WITH_QT6=ON" >> "$GITHUB_ENV" + shell: bash - - name: Install Qt + - name: Install Qt5 + if: startsWith(matrix.qt-version, '5.') uses: jurplel/install-qt-action@v3.2.1 with: cache: true - cache-key-prefix: ${{ runner.os }}-QtCache-${{ matrix.qt-version }} + cache-key-prefix: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}-v2 + version: ${{ matrix.qt-version }} + + - name: Install Qt6 + if: startsWith(matrix.qt-version, '6.') + uses: jurplel/install-qt-action@v3.2.1 + with: + cache: true + cache-key-prefix: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}-v2 + modules: qt5compat qtimageformats version: ${{ matrix.qt-version }} - dir: "${{ github.workspace }}/qt/" # LINUX - name: Install dependencies (Ubuntu) @@ -74,7 +87,11 @@ jobs: - name: Build (Ubuntu) if: startsWith(matrix.os, 'ubuntu') run: | - cmake -DBUILD_TESTS=On -DBUILD_APP=OFF .. + cmake \ + -DBUILD_TESTS=On \ + -DBUILD_APP=OFF \ + -DBUILD_WITH_QT6="$C2_BUILD_WITH_QT6" \ + .. cmake --build . working-directory: build-test shell: bash