Skip to content

Commit

Permalink
[ci] Merge Linux workflows and add LLVM 17 test for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
ntadej committed Oct 14, 2023
1 parent 1016386 commit 2782241
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 204 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/Android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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"

Expand Down Expand Up @@ -104,7 +102,6 @@ jobs:
uses: hendrikmuhs/ccache-action@v1
with:
key: Android_QMapLibre_${{ matrix.config.abi }}
append-timestamp: false

- name: Build QMapLibre
env:
Expand Down
17 changes: 5 additions & 12 deletions .github/workflows/CI-cache-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,9 @@ on:
pull_request:
types:
- closed
workflow_dispatch:

jobs:
cleanup:
runs-on: ubuntu-latest
permissions:
# `actions:write` permission is required to delete caches
# See also: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-a-github-actions-cache-for-a-repository-using-a-cache-id
actions: write
contents: read
steps:
- name: Check out code
uses: actions/checkout@v4
Expand All @@ -21,18 +14,18 @@ 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 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
gh actions-cache delete "$cacheKey" -R "$REPO" -B "$BRANCH" --confirm
done
echo "Done"
env:
Expand Down
161 changes: 0 additions & 161 deletions .github/workflows/Linux-Test.yml

This file was deleted.

98 changes: 90 additions & 8 deletions .github/workflows/Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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"

Expand All @@ -39,20 +37,27 @@ 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:
include:
- 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
Expand All @@ -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:
Expand All @@ -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 }}
Expand Down
Loading

0 comments on commit 2782241

Please sign in to comment.