-
Notifications
You must be signed in to change notification settings - Fork 99
193 lines (171 loc) · 7.78 KB
/
windows_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
name: Windows Build
# This machine tests building the software on a both 32 and 64 Windows architecture.
on: [push]
jobs:
source_build:
name: Build dist with Linux
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: Install prerequisites
run: |
set -x
sudo apt install libpcsclite-dev check gengetopt help2man zlib1g-dev
- name: Create tar.gz
run: |
set -x
./resources/make_src_dist.sh
cd ..
mkdir $GITHUB_WORKSPACE/artifact
mv $GITHUB_WORKSPACE/yubico-piv-tool-.tar.gz $GITHUB_WORKSPACE/artifact/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: yubico-piv-tool-src
path: artifact
build:
name: Build and Test on Windows
needs: source_build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-2019
arch: x86
arch_cmake: Win32
- os: windows-2019
arch: x64
arch_cmake: x64
- os: windows-2022
arch: x86
arch_cmake: Win32
- os: windows-2022
arch: x64
arch_cmake: x64
steps:
- name: Download source from source work
uses: actions/download-artifact@v4
with:
name: yubico-piv-tool-src
- name: Extract source
run: |
Set-PSDebug -Trace 1
tar xf yubico-piv-tool-.tar.gz
- name: install prerequisites
env:
ARCH: ${{ matrix.arch }}
run: |
Set-PSDebug -Trace 1
vcpkg install openssl:$env:ARCH-windows
vcpkg install getopt:$env:ARCH-windows
vcpkg install check:$env:ARCH-windows
vcpkg install zlib:$env:ARCH-windows
- name: build
env:
ARCH_CMAKE: ${{ matrix.arch_cmake }}
ARCH: ${{ matrix.arch }}
run: |
Set-PSDebug -Trace 1
$env:Path ="C:\vcpkg\packages\openssl_$env:ARCH-windows;$env:Path"
$env:include ="C:\vcpkg\packages\openssl_$env:ARCH-windows/include;$env:include"
cd yubico-piv-tool-
mkdir build; cd build
cmake -A $env:ARCH_CMAKE -DVERBOSE_CMAKE=ON -DBACKEND=winscard -DGETOPT_LIB_DIR=C:/vcpkg/packages/getopt-win32_$env:ARCH-windows/lib -DGETOPT_INCLUDE_DIR=C:/vcpkg/packages/getopt-win32_$env:ARCH-windows/include -DCHECK_PATH=C:/vcpkg/packages/check_$env:ARCH-windows ..
cmake --build . -v
$env:Path +=";C:/vcpkg/packages/check_$env:ARCH-windows/bin;C:/vcpkg/packages/openssl_$env:ARCH-windows/bin;$env:GITHUB_WORKSPACE\yubico-piv-tool-\build\lib\Debug;$env:GITHUB_WORKSPACE\yubico-piv-tool-\build\ykcs11\Debug"
ctest.exe -C Debug
- name: Build with YKCS11_DBG is set
env:
ARCH_CMAKE: ${{ matrix.arch_cmake }}
ARCH: ${{ matrix.arch }}
run: |
Set-PSDebug -Trace 1
$env:Path ="C:\vcpkg\packages\openssl_$env:ARCH-windows;$env:Path"
$env:include ="C:\vcpkg\packages\openssl_$env:ARCH-windows/include;$env:include"
cd yubico-piv-tool-
rm -r build; mkdir build; cd build
cmake -A $env:ARCH_CMAKE -DVERBOSE_CMAKE=ON -DBACKEND=winscard -DGETOPT_LIB_DIR=C:/vcpkg/packages/getopt-win32_$env:ARCH-windows/lib -DGETOPT_INCLUDE_DIR=C:/vcpkg/packages/getopt-win32_$env:ARCH-windows/include -DCHECK_PATH=C:/vcpkg/packages/check_$env:ARCH-windows -DYKCS11_DBG=3 ..
cmake --build . -v
$env:Path +=";C:/vcpkg/packages/check_$env:ARCH-windows/bin;C:/vcpkg/packages/openssl_$env:ARCH-windows/bin;$env:GITHUB_WORKSPACE\yubico-piv-tool-\build\lib\Debug;$env:GITHUB_WORKSPACE\yubico-piv-tool-\build\ykcs11\Debug"
ctest.exe -C Debug
- name: Build only library (no CLI and no ykcs11)
env:
ARCH_CMAKE: ${{ matrix.arch_cmake }}
ARCH: ${{ matrix.arch }}
run: |
Set-PSDebug -Trace 1
$env:Path ="C:\vcpkg\packages\openssl_$env:ARCH-windows;$env:Path"
$env:include ="C:\vcpkg\packages\openssl_$env:ARCH-windows/include;$env:include"
cd yubico-piv-tool-
rm -r build; mkdir build; cd build
cmake -A $env:ARCH_CMAKE -DVERBOSE_CMAKE=ON -DBACKEND=winscard -DGETOPT_LIB_DIR=C:/vcpkg/packages/getopt-win32_$env:ARCH-windows/lib -DGETOPT_INCLUDE_DIR=C:/vcpkg/packages/getopt-win32_$env:ARCH-windows/include -DCHECK_PATH=C:/vcpkg/packages/check_$env:ARCH-windows -DBUILD_ONLY_LIB=ON ..
cmake --build . -v
$env:Path +=";C:/vcpkg/packages/check_$env:ARCH-windows/bin;C:/vcpkg/packages/openssl_$env:ARCH-windows/bin;$env:GITHUB_WORKSPACE\yubico-piv-tool-\build\lib\Debug;$env:GITHUB_WORKSPACE\yubico-piv-tool-\build\ykcs11\Debug"
ctest.exe -C Debug
- name: Build only dynamic libaries
env:
ARCH_CMAKE: ${{ matrix.arch_cmake }}
ARCH: ${{ matrix.arch }}
run: |
Set-PSDebug -Trace 1
$env:Path ="C:\vcpkg\packages\openssl_$env:ARCH-windows;$env:Path"
$env:include ="C:\vcpkg\packages\openssl_$env:ARCH-windows/include;$env:include"
cd yubico-piv-tool-
rm -r build; mkdir build; cd build
cmake -A $env:ARCH_CMAKE -DVERBOSE_CMAKE=ON -DBACKEND=winscard -DGETOPT_LIB_DIR=C:/vcpkg/packages/getopt-win32_$env:ARCH-windows/lib -DGETOPT_INCLUDE_DIR=C:/vcpkg/packages/getopt-win32_$env:ARCH-windows/include -DCHECK_PATH=C:/vcpkg/packages/check_$env:ARCH-windows -DBUILD_STATIC_LIB=OFF ..
cmake --build . -v
$env:Path +=";C:/vcpkg/packages/check_$env:ARCH-windows/bin;C:/vcpkg/packages/openssl_$env:ARCH-windows/bin;$env:GITHUB_WORKSPACE\yubico-piv-tool-\build\lib\Debug;$env:GITHUB_WORKSPACE\yubico-piv-tool-\build\ykcs11\Debug"
ctest.exe -C Debug
build_no_zlib:
name: Build and Test on Windows where zlib is not installed
needs: source_build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-2019
arch: x86
arch_cmake: Win32
- os: windows-2019
arch: x64
arch_cmake: x64
- os: windows-2022
arch: x86
arch_cmake: Win32
- os: windows-2022
arch: x64
arch_cmake: x64
steps:
- name: Download source from source work
uses: actions/download-artifact@v4
with:
name: yubico-piv-tool-src
- name: Extract source
run: |
Set-PSDebug -Trace 1
tar xf yubico-piv-tool-.tar.gz
- name: install prerequisites
env:
ARCH: ${{ matrix.arch }}
run: |
Set-PSDebug -Trace 1
vcpkg install openssl:$env:ARCH-windows
vcpkg install getopt:$env:ARCH-windows
vcpkg install check:$env:ARCH-windows
- name: build
env:
ARCH_CMAKE: ${{ matrix.arch_cmake }}
ARCH: ${{ matrix.arch }}
run: |
Set-PSDebug -Trace 1
$env:Path ="C:\vcpkg\packages\openssl_$env:ARCH-windows;$env:Path"
$env:include ="C:\vcpkg\packages\openssl_$env:ARCH-windows/include;$env:include"
cd yubico-piv-tool-
mkdir build; cd build
cmake -A $env:ARCH_CMAKE -DVERBOSE_CMAKE=ON -DBACKEND=winscard -DENABLE_CERT_COMPRESS=OFF -DGETOPT_LIB_DIR=C:/vcpkg/packages/getopt-win32_$env:ARCH-windows/lib -DGETOPT_INCLUDE_DIR=C:/vcpkg/packages/getopt-win32_$env:ARCH-windows/include -DCHECK_PATH=C:/vcpkg/packages/check_$env:ARCH-windows ..
cmake --build . -v
$env:Path +=";C:/vcpkg/packages/check_$env:ARCH-windows/bin;C:/vcpkg/packages/openssl_$env:ARCH-windows/bin;$env:GITHUB_WORKSPACE\yubico-piv-tool-\build\lib\Debug;$env:GITHUB_WORKSPACE\yubico-piv-tool-\build\ykcs11\Debug"
ctest.exe -C Debug