-
Notifications
You must be signed in to change notification settings - Fork 30
148 lines (128 loc) · 3.9 KB
/
cmake.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
---
name: CMake
# yamllint disable-line rule:truthy
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: ${{matrix.buildname}}
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os:
- windows-latest
- macos-latest
include:
- os: windows-latest
buildname: Windows
triplet: x64-windows
- os: macos-latest
buildname: macOS
triplet: x64-osx
compiler: clang_64
env:
qt: '5.15.2'
steps:
- name: Restore Qt cache
uses: actions/cache@v2
id: cache-qt
with:
path: ${{runner.workspace}}/Qt/${{env.qt}}
key: ${{runner.os}}-qt-${{env.qt}}
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{env.qt}}
dir: ${{runner.workspace}}
cached: ${{steps.cache-qt.outputs.cache-hit}}
- name: Checkout source code
uses: actions/checkout@v2
with:
submodules: false
fetch-depth: 0
- name: Build with CMake
uses: lukka/run-cmake@v3
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: '${{github.workspace}}/CMakeLists.txt'
cmakeBuildType: Release
cmakeGenerator: Ninja
buildDirectory: '${{runner.workspace}}/build'
cmakeAppendedArgs: >-
-DBUILD_TESTS=TRUE
-DBUILD_EXAMPLE=TRUE
-DCMAKE_PREFIX_PATH='${{runner.workspace}}/Qt/${{env.qt}}/${{matrix.compiler}}/'
- name: Run tests
working-directory: '${{runner.workspace}}/build'
run: ctest --output-on-failure
build_linux:
name: Linux
runs-on: ubuntu-20.04
env:
# Required for Linux/X11 for running GUI tests.
DISPLAY: ':99'
steps:
- name: (Linux) Install dependencies
if: runner.os == 'Linux'
run: >-
sudo apt-get install
libqt5test5
libqt5widgets5
ninja-build
openbox
pyqt5-dev
python3-pyqt5
python3-sip
qtbase5-dev
xvfb
- name: Checkout source code
uses: actions/checkout@v2
with:
submodules: false
fetch-depth: 0
- name: Build with CMake
uses: lukka/run-cmake@v3
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: '${{github.workspace}}/CMakeLists.txt'
cmakeBuildType: Release
cmakeGenerator: Ninja
buildDirectory: '${{runner.workspace}}/build'
cmakeAppendedArgs: >-
-DBUILD_TESTS=TRUE
-DBUILD_EXAMPLE=TRUE
-DCMAKE_INSTALL_PREFIX='${{runner.workspace}}/install'
- name: Install with CMake
run: cmake --install '${{runner.workspace}}/build'
- name: (Linux) Start X11 and window manager
if: runner.os == 'Linux'
working-directory: '${{runner.workspace}}/build'
shell: bash
run: |
Xvfb $DISPLAY -screen 0 800x600x24 & sleep 5
openbox & sleep 8
- name: Run tests
working-directory: '${{runner.workspace}}/build'
run: ctest --output-on-failure
- name: (Linux) Build Python library
if: runner.os == 'Linux'
working-directory: '${{github.workspace}}/python'
env:
PYTHON: python3
LIBRARY_PATH: '${{runner.workspace}}/install/lib'
INCLUDE_PATH: '${{runner.workspace}}/install/include'
run: ./build.sh
- name: (Linux) Test Python library
if: runner.os == 'Linux'
working-directory: '${{github.workspace}}/python'
env:
PYTHONPATH: '${{github.workspace}}/python/build'
LD_LIBRARY_PATH: '${{runner.workspace}}/install'
FAKEVIM_CMD: ':q'
run: python3 test.py