-
Notifications
You must be signed in to change notification settings - Fork 99
171 lines (135 loc) · 5.38 KB
/
linux_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
name: Ubuntu Build
# This workflow is triggered on pushes to the repository. This is a test machine and nothing produced here will be used
# in the official release
on: [push]
jobs:
ununtu_builds:
name: Build with various configurations
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
- os: ubuntu-22.04
- os: ubuntu-20.04
steps:
# This action checks-out the repository under $GITHUB_WORKSPACE, so the workflow can access it.
- name: checkout
uses: actions/checkout@v2
- name: Install prerequisites
run: |
set -x
sudo apt install libpcsclite-dev check gengetopt help2man openssl opensc zlib1g-dev
- name: Build and install
run: |
set -x
mkdir build; cd build
cmake .. -DVERBOSE_CMAKE=ON
make
make test
ldd tool/yubico-piv-tool | grep libcrypto.so
ldd lib/libykpiv.so | grep libcrypto.so
ldd ykcs11/libykcs11.so | grep libcrypto.so
./tool/yubico-piv-tool --help | grep "Usage: yubico-piv-tool"
pkcs11-tool --module ykcs11/libykcs11.so --show-info | grep Yubico
sudo make install
sudo ldconfig
cd ..
LIBDIR=$(cmake -L | sed -n "s/^.*YKPIV_INSTALL_LIB_DIR:PATH=\s*\(\S*\).*$/\1/p")
BINDIR=$(cmake -L | sed -n "s/^.*YKPIV_INSTALL_BIN_DIR:PATH=\s*\(\S*\).*$/\1/p")
echo "libdir: $LIBDIR"
echo "bindir: $BINDIR"
yubico-piv-tool --help | grep "Usage: yubico-piv-tool"
objdump -T $LIBDIR/libykcs11.so | grep C_Sign
pkcs11-tool --module $LIBDIR/libykcs11.so --show-info | grep Yubico
sudo rm $BINDIR/yubico-piv-tool
sudo rm $LIBDIR/libyk*
- name: Build and install debian package
run: |
set -x
mkdir build_dir;
cd build_dir; cmake -DCMAKE_INSTALL_PREFIX=../debian/tmp/usr .. -B .
cd ..
make -C build_dir
cd build_dir; cmake -P cmake_install.cmake
cd ..
mkdir debian/tmp/DEBIAN
dpkg-gencontrol -pyubico-piv-tool
dpkg --build debian/tmp build_dir/
cd build_dir
sudo apt install ./yubico-piv-tool_*_amd64.deb
(set +e; yubico-piv-tool -a status; true) 2>&1 >/dev/null | grep "Failed to connect to yubikey."
- name: Build using OpenSSL static link
run: |
set -x
rm -rf build; mkdir build; cd build
cmake .. -DVERBOSE_CMAKE=ON -DOPENSSL_STATIC_LINK=ON -B .
make
make test
ldd tool/yubico-piv-tool | grep libcrypto.so | wc -l | grep 0
ldd lib/libykpiv.so | grep libcrypto.so | wc -l | grep 0
ldd ykcs11/libykcs11.so | grep libcrypto.so | wc -l | grep 0
pkcs11-tool --module ykcs11/libykcs11.so --show-info | grep Yubico
sudo make install
sudo ldconfig
yubico-piv-tool --help | grep "Usage: yubico-piv-tool"
cd ..
LIBDIR=$(cmake -L | sed -n "s/^.*YKPIV_INSTALL_LIB_DIR:PATH=\s*\(\S*\).*$/\1/p")
pkcs11-tool --module $LIBDIR/libykcs11.so --show-info | grep Yubico
- name: Build with YKCS11_DBG is set
run: |
set -x
rm -rf build; mkdir build; cd build
cmake .. -DVERBOSE_CMAKE=ON -DYKCS11_DBG=3 -B .
make
make test
ldd ykcs11/libykcs11.so | grep libcrypto.so
pkcs11-tool --module ykcs11/libykcs11.so --show-info | grep Yubico
- name: Build only library (no CLI and no ykcs11)
run: |
set -x
rm -rf build; mkdir build; cd build
cmake .. -DVERBOSE_CMAKE=ON -DBUILD_ONLY_LIB=ON -B .
make
make test
- name: Build only dynamic libaries
run: |
set -x
rm -rf build; mkdir build; cd build
cmake .. -DVERBOSE_CMAKE=ON -DBUILD_STATIC_LIB=OFF -B .
make
make test
ubuntu2004:
name: Build without zlib
runs-on: ubuntu-latest
steps:
# This action checks-out the repository under $GITHUB_WORKSPACE, so the workflow can access it.
- name: checkout
uses: actions/checkout@v2
- name: Install prerequisites
run: |
set -x
sudo apt install libpcsclite-dev check gengetopt help2man openssl opensc
- name: Build and install
run: |
set -x
mkdir build; cd build
cmake .. -DVERBOSE_CMAKE=ON -DENABLE_CERT_COMPRESS=OFF
make
make test
ldd tool/yubico-piv-tool | grep libcrypto.so
ldd lib/libykpiv.so | grep libcrypto.so
ldd ykcs11/libykcs11.so | grep libcrypto.so
./tool/yubico-piv-tool --help | grep "Usage: yubico-piv-tool"
pkcs11-tool --module ykcs11/libykcs11.so --show-info | grep Yubico
sudo make install
sudo ldconfig
cd ..
LIBDIR=$(cmake -L | sed -n "s/^.*YKPIV_INSTALL_LIB_DIR:PATH=\s*\(\S*\).*$/\1/p")
BINDIR=$(cmake -L | sed -n "s/^.*YKPIV_INSTALL_BIN_DIR:PATH=\s*\(\S*\).*$/\1/p")
yubico-piv-tool --help | grep "Usage: yubico-piv-tool"
objdump -T $LIBDIR/libykcs11.so | grep C_Sign
pkcs11-tool --module $LIBDIR/libykcs11.so --show-info | grep Yubico
sudo rm $BINDIR/yubico-piv-tool
sudo rm $LIBDIR/libyk*