-
Notifications
You must be signed in to change notification settings - Fork 171
131 lines (116 loc) · 3.91 KB
/
build-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
name: Build And Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
BuildTest:
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: Linux_GCC
flavor: Debug
runner: ubuntu-22.04
generator: Ninja
cc: gcc
cxx: g++
- name: Linux_LLVM
flavor: Debug
runner: ubuntu-22.04
generator: Ninja
cc: clang
cxx: clang++
- name: Linux_Release
flavor: Release
runner: ubuntu-20.04
generator: Ninja
cc: gcc
cxx: g++
publish: true
- name: MacOS_GCC
flavor: Debug
runner: macos-12
generator: Ninja
cc: gcc-11
cxx: g++-11
- name: MacOS_Release
flavor: Release
runner: macos-12
generator: Ninja
cc: clang
cxx: clang++
publish: true
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v2
#
# Setup and Configuration
#
- name: Linux - Setup
if: ${{ startsWith(matrix.runner, 'ubuntu') }}
run: |
sudo add-apt-repository -y ppa:neovim-ppa/stable
sudo apt-get install -y neovim ninja-build libqt5svg5 libqt5svg5-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
sudo apt-get update -y
- name: MacOS - Setup
if: ${{ startsWith(matrix.runner, 'macos') }}
run: |
brew install neovim
brew ls --formula | grep -wq ninja || brew install ninja
brew ls --formula | grep -wq qt5 || brew install qt@5
brew ls --formula | grep -wq msgpack || brew install msgpack
#
# Build and Test
#
- name: Neovim Version
run: nvim --version
- name: Configure
env:
CMAKE_BUILD_TYPE: ${{ matrix.flavor }}
CMAKE_GENERATOR: ${{ matrix.generator }}
run: >
env PATH=${{ startsWith(matrix.runner, 'macos') && '/usr/local/opt/qt@5/bin:' || '' }}/usr/local/bin:/usr/bin/:/bin
cmake -B ./build
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install
-DCMAKE_C_COMPILER=${{ matrix.cc }}
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }}
-DENABLE_TESTS=ON
-DCTEST_EXE_ARGS=${{ matrix.ctest_exe_args }}
- name: Build
run: cmake --build ${{ github.workspace }}/build
- name: Test
uses: GabrielBB/xvfb-action@v1 # Required by Linux, no X11 $DISPLAY
with:
working-directory: ${{ github.workspace }}/build
run: ctest -VV --timeout 120 --output-on-failure -C ${{ matrix.flavor }}
#
# Deploy Release Binaries
#
- name: Linux - Publish
if: ${{ matrix.publish && startsWith(matrix.runner, 'ubuntu') }}
env:
ARCH: x86_64
run: |
cmake --build ./build --target install
wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
chmod a+x linuxdeployqt-continuous-x86_64.AppImage
./linuxdeployqt-continuous-x86_64.AppImage ./install/share/applications/nvim-qt.desktop -appimage -qmake=/usr/lib/qt5/bin/qmake
- name: MacOS - Publish
if: ${{ matrix.publish && startsWith(matrix.runner, 'macos') }}
run: |
/usr/local/opt/qt@5/bin/macdeployqt ./build/bin/nvim-qt.app -dmg
mv ./build/bin/nvim-qt.dmg neovim-qt.dmg
- name: Upload Artifacts
if: ${{ matrix.publish }}
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.name }}
if-no-files-found: ignore
path: |
Neovim-Qt-*-x86_64.AppImage
neovim-qt.dmg
neovim-qt-installer.msi
neovim-qt.zip