-
-
Notifications
You must be signed in to change notification settings - Fork 17
157 lines (141 loc) · 4.46 KB
/
Linux-Test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
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
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