forked from open-eid/DigiDoc4-Client
-
Notifications
You must be signed in to change notification settings - Fork 2
259 lines (259 loc) · 8.5 KB
/
build.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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
name: CI
on: [push, pull_request]
env:
BUILD_NUMBER: ${{ github.run_number }}
MAKEFLAGS: -j3
jobs:
macos:
name: Build on macOS
runs-on: macos-latest
env:
MACOSX_DEPLOYMENT_TARGET: 10.14
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Download artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: build.yml
branch: master
name: pkgs
path: libdigidocpp-pkg
repo: open-eid/libdigidocpp
- name: Install dependencies
run: |
HASH=($(shasum prepare_osx_build_environment.sh))
curl -O -L -s https://installer.id.ee/media/github/opensc_0.22.0.pkg
curl -O -L -s https://installer.id.ee/media/github/${HASH}.zip
sudo installer -verboseR -pkg libdigidocpp-pkg/libdigidocpp*.pkg -target /
sudo installer -verboseR -pkg opensc_*.pkg -target /
sudo unzip -qq -d /Library/Developer ${HASH}.zip
- name: Build
run: |
QT_DIR=$(ls -d /Library/Developer/Qt-*-OpenSSL | tail -n 1)
cmake \
-DCMAKE_PREFIX_PATH=${QT_DIR} \
-DOPENSSL_ROOT_DIR=/Library/Developer/OpenSSL \
-DLDAP_ROOT=/Library/Developer/OpenLDAP \
-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -B build -S .
cmake --build build --target zipdebug macdeployqt zip
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: pkgs
path: build/qdigidoc4*.zip
ubuntu:
name: Build on Ubuntu to ${{ matrix.container }}
runs-on: ubuntu-latest
container: ${{ matrix.container }}
strategy:
matrix:
container: ['ubuntu:20.04', 'ubuntu:22.04']
env:
DEBIAN_FRONTEND: noninteractive
DEBFULLNAME: github-actions
DEBEMAIL: [email protected]
steps:
- name: Checkout
uses: actions/checkout@v1
with:
submodules: recursive
- name: Install dependencies
run: apt update -qq && apt install --no-install-recommends -y lsb-release fakeroot build-essential devscripts cdbs pkg-config cmake libldap2-dev gettext libpcsclite-dev libssl-dev libqt5svg5-dev qttools5-dev-tools qttools5-dev lintian
- name: Download artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: build.yml
branch: master
name: debs
path: libdigidocpp-pkg
repo: open-eid/libdigidocpp
- name: Install artifact
run: |
apt install --no-install-recommends -y ./libdigidocpp-pkg/*$(lsb_release -rs)*.deb
rm -rf libdigidocpp-pkg
- name: Setup changelog
run: |
export VERSION=$(grep project CMakeLists.txt | egrep -o "([0-9]{1,}\.)+[0-9]{1,}")
export VERSIONEX=${VERSION}.${BUILD_NUMBER}.$(lsb_release -rs)
dch --distribution $(lsb_release -cs) -v ${VERSIONEX} "Release ${VERSIONEX}."
- name: Build packages
run: |
dpkg-buildpackage -us -uc
mv ../qdigidoc4*.* .
- name: Lintian
run: lintian *.deb;
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: debs
path: qdigidoc4*.*
fedora:
name: Build on Fedora to ${{ matrix.container }}
runs-on: ubuntu-latest
container: ${{ matrix.container }}
strategy:
matrix:
container: ['fedora:35']
env:
MAKEFLAGS: -j3
steps:
- name: Checkout
uses: actions/checkout@v1
with:
submodules: recursive
- name: Install Deps
run: dnf install -y gcc-c++ cmake rpm-build gettext openssl-devel openldap-devel pcsc-lite-devel qt5-qtsvg-devel qt5-linguist
- name: Download artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: build.yml
branch: master
name: rpms
path: libdigidocpp-pkg
repo: open-eid/libdigidocpp
- name: Install artifact
run: dnf install -y ./libdigidocpp-pkg/*$(lsb_release -rs)*.rpm
- name: Build
run: |
cmake -DCMAKE_INSTALL_PREFIX=/usr -B build -S .
cmake --build build --target all package
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: rpms
path: build/qdigidoc4*.rpm
windows:
name: Build on Windows
runs-on: ${{ matrix.image }}
strategy:
matrix:
vcver: [141, 142, 143]
arch: [x64]
qtver: [5.12.12]
include:
- arch: x64
qt: win64_msvc2017_64
- vcver: 141
image: windows-2019
toolset: 14.16
- vcver: 142
image: windows-2019
toolset: 14.29
- vcver: 143
image: windows-2022
toolset: 14.32
- vcver: 142
arch: x86
qtver: 5.12.12
qt: win32_msvc2017
image: windows-2019
toolset: 14.29
- vcver: 142
arch: x64
qtver: 6.3.1
qtmodules: qt5compat
qt: win64_msvc2019_64
image: windows-2019
toolset: 14.29
env:
VER_SUFFIX: .VS${{ matrix.vcver }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Download artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: build.yml
branch: master
name: msi
path: ./
repo: open-eid/libdigidocpp
- name: Install artifact
run: |
Rename-Item "libdigidocpp*VS${{ matrix.vcver }}.msi" libdigidocpp.msi
msiexec /qn /a libdigidocpp.msi "TARGETDIR=$($pwd.Path)\\libs"
- name: Prepare vcpkg
uses: lukka/run-vcpkg@v7
with:
vcpkgArguments: openssl
vcpkgGitCommitId: a69b65229b3956b7f45abd81671b7330114bcaad
vcpkgTriplet: ${{ matrix.arch }}-windows
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{ matrix.qtver }}
arch: ${{ matrix.qt }}
modules: ${{ matrix.qtmodules }}
- name: Setup dev env
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
sdk: 10.0.17763.0
toolset: ${{ matrix.toolset }}
- name: Build
run: |
md build/client
copy ${{ env.VCPKG_ROOT }}\installed\${{ matrix.arch }}-windows\bin\*.dll build\client\
cmake "-GNinja" -DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake `
"-DLIBDIGIDOCPP_LIBRARY=libs/libdigidocpp/${{ matrix.arch }}/digidocpp.lib" `
"-DLIBDIGIDOCPP_INCLUDE_DIR=libs/libdigidocpp/include" -B build -S .
cmake --build build --target msi
cmake --build build --target appx
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: msi
path: |
build/*.msi
build/*.appx
coverity:
name: Run Coverity tests
if: contains(github.repository, 'open-eid/DigiDoc4-Client') && contains(github.ref, 'coverity_scan')
runs-on: ubuntu-20.04
env:
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
PROJECTNAME: open-eid/DigiDoc4-Client
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install dependencies
run: sudo apt update -qq && sudo apt install --no-install-recommends -y cmake libldap2-dev gettext libpcsclite-dev libminizip-dev libxml-security-c-dev libqt5svg5-dev qttools5-dev-tools qttools5-dev
- name: Download artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: build.yml
branch: master
name: debs
path: libdigidocpp-pkg
repo: open-eid/libdigidocpp
- name: Install artifact
run: sudo dpkg -i libdigidocpp-pkg/*$(lsb_release -rs)*.deb
- name: Download Coverity Build Tool
run: |
curl -s -d "token=$TOKEN&project=$PROJECTNAME" -o cov-analysis-linux64.tar.gz https://scan.coverity.com/download/cxx/linux64
mkdir cov-analysis-linux64
tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64
- name: Build
run: |
cmake .
export PATH=$PWD/cov-analysis-linux64/bin:$PATH
cov-build --dir cov-int make
- name: Submit the result to Coverity Scan
run: |
tar czvf upload.tgz cov-int
curl -s \
-F project=$PROJECTNAME \
-F token=$TOKEN \
-F [email protected] \
-F [email protected] \
-F version=master \
-F description="Github Actions CI build" \
https://scan.coverity.com/builds?project=$PROJECTNAME