diff --git a/.github/workflows/Android.yml b/.github/workflows/Android.yml index d7d491b..1d2f00e 100644 --- a/.github/workflows/Android.yml +++ b/.github/workflows/Android.yml @@ -15,7 +15,6 @@ on: # - ".github/actions/**" # - ".github/workflows/iOS.yml" # - ".github/workflows/Linux.yml" - # - ".github/workflows/Linux-Test.yml" # - ".github/workflows/macOS.yml" # - ".github/workflows/Windows.yml" @@ -30,7 +29,6 @@ on: # - ".github/actions/**" # - ".github/workflows/iOS.yml" # - ".github/workflows/Linux.yml" - # - ".github/workflows/Linux-Test.yml" # - ".github/workflows/macOS.yml" # - ".github/workflows/Windows.yml" @@ -104,7 +102,6 @@ jobs: uses: hendrikmuhs/ccache-action@v1 with: key: Android_QMapLibre_${{ matrix.config.abi }} - append-timestamp: false - name: Build QMapLibre env: diff --git a/.github/workflows/CI-cache-cleanup.yml b/.github/workflows/CI-cache-cleanup.yml index 387b706..a4a5efb 100644 --- a/.github/workflows/CI-cache-cleanup.yml +++ b/.github/workflows/CI-cache-cleanup.yml @@ -21,18 +21,19 @@ jobs: run: | gh extension install actions/gh-actions-cache - REPO=${{ github.repository }} - BRANCH=refs/pull/${{ github.event.pull_request.number }}/merge + REPO="${{ github.repository }}" + BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge" echo "Fetching list of cache key" - cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 ) + cacheKeysForPR=$(gh actions-cache list -R "$REPO" -B "$BRANCH" | cut -f 1 ) ## Setting this to not fail the workflow while deleting cache keys. set +e echo "Deleting caches..." for cacheKey in $cacheKeysForPR do - gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm + echo "gh actions-cache delete \"$cacheKey\" -R \"$REPO\" -B \"$BRANCH\" --confirm" + gh actions-cache delete "$cacheKey" -R "$REPO" -B "$BRANCH" --confirm done echo "Done" env: diff --git a/.github/workflows/Linux-Test.yml b/.github/workflows/Linux-Test.yml deleted file mode 100644 index 6990ff4..0000000 --- a/.github/workflows/Linux-Test.yml +++ /dev/null @@ -1,161 +0,0 @@ -name: Linux CI (Test) - -on: - workflow_dispatch: - push: - branches: - - main - tags: - - "**" - paths-ignore: - - ".gitignore" - - "README.md" - # ignore CI for other platforms - - ".github/FUNDING.yml" - - ".github/workflows/Android.yml" - - ".github/workflows/iOS.yml" - - ".github/workflows/Linux.yml" - - ".github/workflows/macOS.yml" - - ".github/workflows/Windows.yml" - - pull_request: - branches: - - main - paths-ignore: - - ".gitignore" - - "README.md" - # ignore CI for other platforms - - ".github/FUNDING.yml" - - ".github/workflows/Android.yml" - - ".github/workflows/iOS.yml" - - ".github/workflows/Linux.yml" - - ".github/workflows/macOS.yml" - - ".github/workflows/Windows.yml" - -concurrency: - # cancel jobs on PRs only - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} - -jobs: - build-and-test: - name: Build QMapLibre (Qt ${{ matrix.qt_version}}, ${{ matrix.compiler }}) - runs-on: ubuntu-22.04 - strategy: - matrix: - include: - - qt_series: 6 - qt_version: 6.5.3 - qt_modules: qtlocation qtpositioning - compiler: gcc-13 - - qt_series: 6 - qt_version: 6.6.0 - qt_modules: qtlocation qtpositioning - compiler: gcc-13 - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - path: source - submodules: recursive - fetch-depth: 0 - - - name: Install test dependencies - run: | - sudo apt-get install \ - libxkbcommon-x11-0 \ - libxcb-cursor0 \ - libxcb-icccm4 \ - libxcb-image0 \ - libxcb-keysyms1 \ - libxcb-randr0 \ - libxcb-render-util0 \ - libxcb-xinerama0 \ - libxcb-xfixes0 \ - libegl1-mesa - - - name: Install compiler - id: install_compiler - uses: rlalik/setup-cpp-compiler@master - with: - compiler: ${{ matrix.compiler }} - - - name: Download Qt - uses: jurplel/install-qt-action@v3 - with: - aqtversion: ==3.1.* - version: ${{ matrix.qt_version }} - dir: ${{ github.workspace }} - target: desktop - modules: ${{ matrix.qt_modules }} - - - name: Setup ninja - uses: seanmiddleditch/gha-setup-ninja@v3 - - - name: Set up ccache - uses: hendrikmuhs/ccache-action@v1 - with: - key: Linux_QMapLibre_${{ matrix.qt_version }}_${{ matrix.compiler }} - append-timestamp: false - - - name: Build QMapLibre (Qt 6) - if: matrix.qt_series == 6 - env: - CC: ${{ steps.install_compiler.outputs.cc }} - CXX: ${{ steps.install_compiler.outputs.cxx }} - run: | - mkdir build && cd build - qt-cmake ../source/ \ - -G Ninja \ - -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ - -DCMAKE_C_COMPILER_LAUNCHER="ccache" \ - -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ - -DCMAKE_INSTALL_PREFIX="../install" \ - -DMLN_QT_WITH_INTERNAL_ICU=ON - ninja - ninja install - - - name: Run tests - uses: coactions/setup-xvfb@v1 - with: - run: ctest --output-on-failure - working-directory: build - - - name: Build QtQuick Example (Qt 6) - if: matrix.qt_series == 6 - run: | - export PREFIX_PATH="$(pwd)/install" - mkdir build-example-quick && cd build-example-quick - qt-cmake ../source/examples/quick/ \ - -G Ninja \ - -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ - -DCMAKE_C_COMPILER_LAUNCHER="ccache" \ - -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ - -DCMAKE_PREFIX_PATH="$PREFIX_PATH" - ninja - - - name: Build QtWidgets Example (Qt 6) - if: matrix.qt_series == 6 - run: | - export PREFIX_PATH="$(pwd)/install" - mkdir build-example-widgets && cd build-example-widgets - qt-cmake ../source/examples/widgets/ \ - -G Ninja \ - -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ - -DCMAKE_C_COMPILER_LAUNCHER="ccache" \ - -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ - -DCMAKE_PREFIX_PATH="$PREFIX_PATH" - ninja - - - name: Create artifacts - run: | - pushd install - tar cjvf ../QMapLibre_Linux.tar.bz2 * - popd - - - name: Upload installation - uses: actions/upload-artifact@v3 - with: - name: QMapLibre_Linux_${{ matrix.qt_version }}_${{ matrix.compiler }} - path: QMapLibre_Linux.tar.bz2 diff --git a/.github/workflows/Linux.yml b/.github/workflows/Linux.yml index e773617..f4b2b40 100644 --- a/.github/workflows/Linux.yml +++ b/.github/workflows/Linux.yml @@ -14,7 +14,6 @@ on: - ".github/FUNDING.yml" - ".github/workflows/Android.yml" - ".github/workflows/iOS.yml" - - ".github/workflows/Linux-Test.yml" - ".github/workflows/macOS.yml" - ".github/workflows/Windows.yml" @@ -28,7 +27,6 @@ on: - ".github/FUNDING.yml" - ".github/workflows/Android.yml" - ".github/workflows/iOS.yml" - - ".github/workflows/Linux-Test.yml" - ".github/workflows/macOS.yml" - ".github/workflows/Windows.yml" @@ -39,7 +37,7 @@ concurrency: jobs: build-and-test: - name: Build QMapLibre (Qt ${{ matrix.qt_version}}) + name: Build QMapLibre for Linux (Qt${{ matrix.qt_version}}, ${{ matrix.compiler }}) runs-on: ubuntu-22.04 strategy: matrix: @@ -47,12 +45,19 @@ jobs: - qt_series: 5 qt_version: 5.15.2 qt_modules: "" + compiler: "" - qt_series: 6 qt_version: 6.5.3 qt_modules: qtlocation qtpositioning + compiler: "" - qt_series: 6 qt_version: 6.6.0 qt_modules: qtlocation qtpositioning + compiler: "" + - qt_series: 6 + qt_version: 6.6.0 + qt_modules: qtlocation qtpositioning + compiler: gcc-13 steps: - name: Checkout @@ -62,6 +67,28 @@ jobs: submodules: recursive fetch-depth: 0 + - name: Install test dependencies + if: matrix.compiler != '' + run: | + sudo apt-get install \ + libxkbcommon-x11-0 \ + libxcb-cursor0 \ + libxcb-icccm4 \ + libxcb-image0 \ + libxcb-keysyms1 \ + libxcb-randr0 \ + libxcb-render-util0 \ + libxcb-xinerama0 \ + libxcb-xfixes0 \ + libegl1-mesa + + - name: Install compiler + id: install_compiler + if: matrix.compiler != '' + uses: rlalik/setup-cpp-compiler@master + with: + compiler: ${{ matrix.compiler }} + - name: Download Qt uses: jurplel/install-qt-action@v3 with: @@ -71,27 +98,82 @@ jobs: target: desktop modules: ${{ matrix.qt_modules }} + - name: Setup ninja + if: matrix.compiler != '' + uses: seanmiddleditch/gha-setup-ninja@v3 + - name: Set up ccache uses: hendrikmuhs/ccache-action@v1 with: - key: Linux_QMapLibre_${{ matrix.qt_version }} - append-timestamp: false + key: Linux_QMapLibre_${{ matrix.qt_version }}_${{ matrix.compiler }} - name: Build QMapLibre (Qt5) if: matrix.qt_series == 5 uses: ./source/.github/actions/qt5-build - name: Build QMapLibre (Qt6) - if: matrix.qt_series == 6 + if: matrix.qt_series == 6 && matrix.compiler == '' uses: ./source/.github/actions/qt6-build - - name: Create artifacts + - name: Build QMapLibre (Qt6, custom compiler) + if: matrix.qt_series == 6 && matrix.compiler != '' + env: + CC: ${{ steps.install_compiler.outputs.cc }} + CXX: ${{ steps.install_compiler.outputs.cxx }} + run: | + mkdir build && cd build + qt-cmake ../source/ \ + -G Ninja \ + -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ + -DCMAKE_C_COMPILER_LAUNCHER="ccache" \ + -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ + -DCMAKE_INSTALL_PREFIX="../install" \ + -DMLN_QT_WITH_INTERNAL_ICU=ON + ninja + ninja install + + - name: Run tests + if: matrix.qt_series == 6 && matrix.compiler != '' + uses: coactions/setup-xvfb@v1 + with: + run: ctest --output-on-failure + working-directory: build + + - name: Build QtQuick Example (Qt6) + if: matrix.qt_series == 6 && matrix.compiler != '' + run: | + export PREFIX_PATH="$(pwd)/install" + mkdir build-example-quick && cd build-example-quick + qt-cmake ../source/examples/quick/ \ + -G Ninja \ + -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ + -DCMAKE_C_COMPILER_LAUNCHER="ccache" \ + -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ + -DCMAKE_PREFIX_PATH="$PREFIX_PATH" + ninja + + - name: Build QtWidgets Example (Qt6) + if: matrix.qt_series == 6 && matrix.compiler != '' + run: | + export PREFIX_PATH="$(pwd)/install" + mkdir build-example-widgets && cd build-example-widgets + qt-cmake ../source/examples/widgets/ \ + -G Ninja \ + -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ + -DCMAKE_C_COMPILER_LAUNCHER="ccache" \ + -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ + -DCMAKE_PREFIX_PATH="$PREFIX_PATH" + ninja + + - name: Compress installation + if: matrix.compiler == '' run: | pushd install tar cjvf ../QMapLibre_Linux.tar.bz2 * popd - - name: Upload installationUpload artifacts + - name: Upload installation + if: matrix.compiler == '' uses: actions/upload-artifact@v3 with: name: QMapLibre_Linux_${{ matrix.qt_version }} diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index cfb2a20..1233e70 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -16,7 +16,6 @@ on: # - ".github/workflows/Android.yml" # - ".github/workflows/iOS.yml" # - ".github/workflows/Linux.yml" - # - ".github/workflows/Linux-Test.yml" # - ".github/workflows/macOS.yml" # pull_request: @@ -31,7 +30,6 @@ on: # - ".github/workflows/Android.yml" # - ".github/workflows/iOS.yml" # - ".github/workflows/Linux.yml" - # - ".github/workflows/Linux-Test.yml" # - ".github/workflows/macOS.yml" concurrency: @@ -105,7 +103,6 @@ jobs: uses: hendrikmuhs/ccache-action@v1 with: key: Windows_QMapLibre_${{ matrix.config.qtarch }} - append-timestamp: false - name: Build QMapLibre shell: bash diff --git a/.github/workflows/iOS.yml b/.github/workflows/iOS.yml index 2c14775..15e248a 100644 --- a/.github/workflows/iOS.yml +++ b/.github/workflows/iOS.yml @@ -15,7 +15,6 @@ on: # - ".github/actions/**" # - ".github/workflows/Android.yml" # - ".github/workflows/Linux.yml" - # - ".github/workflows/Linux-Test.yml" # - ".github/workflows/macOS.yml" # - ".github/workflows/Windows.yml" @@ -30,7 +29,6 @@ on: # - ".github/actions/**" # - ".github/workflows/Android.yml" # - ".github/workflows/Linux.yml" - # - ".github/workflows/Linux-Test.yml" # - ".github/workflows/macOS.yml" # - ".github/workflows/Windows.yml" @@ -84,7 +82,6 @@ jobs: uses: hendrikmuhs/ccache-action@v1 with: key: iOS_QMapLibre - append-timestamp: false - name: Use custom version of ccache run: | diff --git a/.github/workflows/macOS.yml b/.github/workflows/macOS.yml index 3de61b5..02732d0 100644 --- a/.github/workflows/macOS.yml +++ b/.github/workflows/macOS.yml @@ -16,7 +16,6 @@ on: - ".github/workflows/Android.yml" - ".github/workflows/iOS.yml" - ".github/workflows/Linux.yml" - - ".github/workflows/Linux-Test.yml" - ".github/workflows/Windows.yml" pull_request: @@ -31,7 +30,6 @@ on: - ".github/workflows/Android.yml" - ".github/workflows/iOS.yml" - ".github/workflows/Linux.yml" - - ".github/workflows/Linux-Test.yml" - ".github/workflows/Windows.yml" concurrency: @@ -41,7 +39,7 @@ concurrency: jobs: build-and-test: - name: Build QMapLibre (Qt ${{ matrix.qt_version}}) + name: Build QMapLibre for macOS (Qt${{ matrix.qt_version}}, ${{ matrix.compiler }}) runs-on: macos-13 strategy: matrix: @@ -49,12 +47,32 @@ jobs: - qt_series: 5 qt_version: 5.15.2 qt_modules: "" + compiler: "" + deployment_target: 10.13 + deployment_arch: "x86_64" - qt_series: 6 qt_version: 6.5.3 qt_modules: qtlocation qtpositioning + compiler: "" + deployment_target: 11.0 + deployment_arch: "x86_64" - qt_series: 6 qt_version: 6.6.0 qt_modules: qtlocation qtpositioning + compiler: "" + deployment_target: 11.0 + deployment_arch: x86_64;arm64" + - qt_series: 6 + qt_version: 6.6.0 + qt_modules: qtlocation qtpositioning + compiler: "llvm@17" + deployment_target: 11.0 + deployment_arch: "x86_64" + + env: + COMPILER: ${{ matrix.compiler }} + DEPLOYMENT_TARGET: ${{ matrix.deployment_target }} + DEPLOYMENT_ARCH: ${{ matrix.deployment_arch }} steps: - name: Checkout @@ -69,6 +87,18 @@ jobs: with: xcode-version: latest-stable + - name: Setup compiler (macOS) + if: matrix.compiler != '' + run: | + brew install "$COMPILER" + echo "/usr/local/opt/${COMPILER}/bin" >> "$GITHUB_PATH" + { + echo "CC=/usr/local/opt/${COMPILER}/bin/clang" + echo "CXX=/usr/local/opt/${COMPILER}/bin/clang++" + echo "LDFLAGS=\"-L/usr/local/opt/${COMPILER}/lib\"" + echo "CPPFLAGS=\"-I/usr/local/opt/${COMPILER}/include\"" + } >> "$GITHUB_ENV" + - name: Download Qt uses: jurplel/install-qt-action@v3 with: @@ -83,8 +113,7 @@ jobs: - name: Set up ccache uses: hendrikmuhs/ccache-action@v1 with: - key: macOS_QMapLibre_${{ matrix.qt_version }} - append-timestamp: false + key: macOS_QMapLibre_${{ matrix.qt_version }}_${{ matrix.compiler }} - name: Build QMapLibre (Qt5) if: matrix.qt_series == 5 @@ -96,7 +125,7 @@ jobs: -DCMAKE_C_COMPILER_LAUNCHER="ccache" \ -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ -DCMAKE_INSTALL_PREFIX="../install" \ - -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" + -DCMAKE_OSX_DEPLOYMENT_TARGET="${DEPLOYMENT_TARGET}" ninja ninja test ninja install @@ -111,8 +140,8 @@ jobs: -DCMAKE_C_COMPILER_LAUNCHER="ccache" \ -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ -DCMAKE_INSTALL_PREFIX="../install" \ - -DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" \ - -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" + -DCMAKE_OSX_DEPLOYMENT_TARGET="${DEPLOYMENT_TARGET}" \ + -DCMAKE_OSX_ARCHITECTURES="${DEPLOYMENT_ARCH}" ninja ninja test ninja install @@ -127,8 +156,8 @@ jobs: -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ -DCMAKE_C_COMPILER_LAUNCHER="ccache" \ -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ - -DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" \ - -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \ + -DCMAKE_OSX_DEPLOYMENT_TARGET="${DEPLOYMENT_TARGET}" \ + -DCMAKE_OSX_ARCHITECTURES="${DEPLOYMENT_ARCH}" \ -DCMAKE_PREFIX_PATH="$PREFIX_PATH" ninja ninja deploy @@ -143,20 +172,21 @@ jobs: -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ -DCMAKE_C_COMPILER_LAUNCHER="ccache" \ -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ - -DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" \ - -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \ + -DCMAKE_OSX_DEPLOYMENT_TARGET="${DEPLOYMENT_TARGET}" \ + -DCMAKE_OSX_ARCHITECTURES="${DEPLOYMENT_ARCH}" \ -DCMAKE_PREFIX_PATH="$PREFIX_PATH" ninja ninja deploy - name: Compress installation + if: matrix.compiler == '' run: | pushd install tar cjvf ../QMapLibre_macOS.tar.bz2 * popd - name: Compress examples - if: matrix.qt_series == 6 + if: matrix.qt_series == 6 && matrix.compiler == '' run: | mkdir examples && pushd examples cp -a ../build-example-quick/QMapLibreExampleQuick.app . @@ -165,13 +195,14 @@ jobs: popd - name: Upload installation + if: matrix.compiler == '' uses: actions/upload-artifact@v3 with: name: QMapLibre_macOS_${{ matrix.qt_version }} path: QMapLibre_macOS.tar.bz2 - name: Upload examples - if: matrix.qt_series == 6 + if: matrix.qt_series == 6 && matrix.compiler == '' uses: actions/upload-artifact@v3 with: name: QMapLibre_macOS_${{ matrix.qt_version }}_examples