-
Notifications
You must be signed in to change notification settings - Fork 127
230 lines (182 loc) · 7.16 KB
/
ci.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
name: CI
on:
- push
- pull_request
- workflow_dispatch
jobs:
build-linux-legacy:
name: Linux (legacy)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
run: docker build -f .github/workflows/Dockerfile.legacy .
################################################################################
build-linux-qt6:
name: Linux (Qt6)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
run: docker build -f .github/workflows/Dockerfile.arch-qt6 .
################################################################################
build-sanitizer:
name: Sanitizer (Linux)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
run: docker build -f .github/workflows/Dockerfile.sanitizer .
################################################################################
coverage-linux:
name: Coverage (Linux)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: sudo apt update && sudo apt install --assume-yes --no-install-recommends qtbase5-dev qtdeclarative5-dev qtscript5-dev qttools5-dev qttools5-dev-tools zlib1g-dev libhunspell-dev libpoppler-qt5-dev libpoppler-private-dev liblua5.3-dev xvfb fonts-urw-base35 poppler-data lcov
- name: Configure
run: cmake -B build -DCMAKE_BUILD_TYPE="Debug" -DWITH_COVERAGE=On .
- name: Build
run: cmake --build build
- name: Test
working-directory: build
run: |
echo "::group::Initialization"
lcov --zerocounters --directory .
lcov --capture --initial --directory . --output-file "coverage.base"
echo "::endgroup::"
echo "::group::Run tests"
xvfb-run ctest -V
echo "::endgroup::"
echo "::group::Collect data"
lcov --capture --directory . --output-file "coverage.info"
lcov --add-tracefile "coverage.base" --add-tracefile "coverage.info" --output-file "coverage.info"
lcov --remove "coverage.info" '/usr/*' --output-file "coverage.info"
echo "::endgroup::"
echo "::group::Info"
lcov --list coverage.info #debug info
echo "::endgroup::"
echo "::group::Upload to Codecov"
bash <(curl -s https://codecov.io/bash) || echo "::warning::Codecov did not collect coverage reports"
echo "::endgroup::"
################################################################################
build-win-msys:
name: Windows (MSYS)
runs-on: windows-latest
if: false
defaults:
run:
shell: msys2 {0}
steps:
- name: Configure Git
run: git config --global core.autocrlf input
shell: bash
- name: Setup MSYS
uses: msys2/setup-msys2@v2
with:
update: true
install: mingw-w64-x86_64-cmake git make mingw-w64-x86_64-gcc mingw-w64-x86_64-hunspell mingw-w64-x86_64-lua mingw-w64-x86_64-poppler mingw-w64-x86_64-qt5
- name: Checkout
uses: actions/checkout@v3
- name: Configure
run: cmake -G 'MSYS Makefiles' -B build -DTW_BUILD_ID='github' -DTEXWORKS_ADDITIONAL_LIBS='shlwapi'
- name: Build
run: cmake --build build -j
- name: Test
run: ctest -V
working-directory: build
env:
QT_FORCE_STDERR_LOGGING: 1
################################################################################
build-win-msvc:
name: Windows (MSVC)
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 6.5.*
modules: qt5compat
# Strawberry perl comes with all sorts of libraries (without headers) that
# can wreak havoc when building some of the dependencies
- name: Remove Strawberry Perl
run: rm -r -fo C:/Strawberry
- name: Install dependencies
run: |
cmake -B "${{ runner.workspace }}/tw-deps-build" -S "${{ github.workspace }}/.github/actions/msvc-dependencies" -DCMAKE_INSTALL_PREFIX="${{ runner.workspace }}/tw-deps"
cmake --build "${{ runner.workspace }}/tw-deps-build" --config Release
- name: Configure
run: cmake -B build -DTW_BUILD_ID='github' -DCMAKE_PREFIX_PATH="${{ runner.workspace }}/tw-deps" -Dgp_tool='none' -DQT_DEFAULT_MAJOR_VERSION=6
- name: Build
run: cmake --build build --config Release
- name: Prepare for testing
run: |
cmake -E copy_directory build/share build/Release/share
cd "${{ runner.workspace }}/tw-deps/bin"
cmake -E copy freetype.dll lcms2.dll libhunspell.dll libpng16.dll lua.dll openjp2.dll poppler.dll poppler-qt6.dll tiff.dll zlib1.dll "${{ github.workspace }}/build/Release/"
- name: Test
run: ctest -V -C Release
working-directory: build
env:
QT_FORCE_STDERR_LOGGING: 1
################################################################################
macosx-homebrew:
name: Mac OS X (Homebrew)
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Dependencies
run: |
# /usr/local/bin/2to3 and some other programs, as well as versioned
# variants (e.g. 2to3-3.11) are symlinked to the native python
# installation but prevent the homebrew install from succeeding
# So we remove them
cd /usr/local/bin && rm -f 2to3* idle* pydoc* python*
brew update > /tmp/brew_update.log || { echo "::error::Updating homebrew failed"; cat /tmp/brew_update.log; exit 1; }
brew install hunspell poppler-qt5 lua qt@5
# As poppler-qt5 conflicts with poppler, we need to force-link it
brew link --force poppler-qt5
- name: Configure
run: cmake -B build -DTW_BUILD_ID='github' ${GITHUB_WORKSPACE} -DCMAKE_PREFIX_PATH="`brew --prefix qt@5`"
- name: Build
run: make -j
working-directory: build
- name: Test
run: ctest -V
working-directory: build
################################################################################
build-macosx-macports:
name: Mac OS X (MacPorts)
runs-on: macos-latest
if: false
strategy:
matrix:
include:
- macports-version: 2.6.2
macports-platform: 10.15-Catalina
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install MacPorts
run: |
wget https://github.com/macports/macports-base/releases/download/v${{ matrix.macports-version }}/MacPorts-${{ matrix.macports-version }}-${{ matrix.macports-platform }}.pkg
sudo /usr/sbin/installer -pkg MacPorts-${{ matrix.macports-version }}-${{ matrix.macports-platform }}.pkg -target /
echo "::add-path::/opt/local/bin:/opt/local/sbin"
- name: Install Dependencies
run: sudo port selfupdate && sudo port install hunspell lua poppler-qt5 qt5-qtbase qt5-qtdeclarative qt5-qtscript qt5-qttools
- name: Configure
run: cmake -B build -DTW_BUILD_ID='github' ${GITHUB_WORKSPACE}
- name: Build
run: make -j
working-directory: build
- name: Test
run: ctest -V
working-directory: build