Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Githubactions #496

Merged
merged 4 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 16 additions & 78 deletions .github/workflows/linux_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,17 @@ on: [push]

jobs:

job1:
name: Ubuntu 22.04
runs-on: ubuntu-22.04
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
Expand Down Expand Up @@ -120,23 +128,23 @@ jobs:
make
make test

job2:
name: Ubuntu 20.04
runs-on: ubuntu-20.04
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 zlib1g-dev
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
cmake .. -DVERBOSE_CMAKE=ON -DENABLE_CERT_COMPRESS=OFF
make
make test

Expand All @@ -161,73 +169,3 @@ jobs:

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
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: [push]

jobs:

job_1:
libressl_build:
name: Build with LibreSSL
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -46,51 +46,7 @@ jobs:
yubico-piv-tool --help | grep "Usage: yubico-piv-tool"
objdump -T $LIBDIR/libykcs11.so | grep C_Sign

job_2:
name: Build with OpenSSL 1.0
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: Install prerequisites
run: |
set -x
sudo apt install libpcsclite-dev check gengetopt help2man zlib1g-dev

- name: Install OpenSSL 1.0 from source
run: |
set -x
cd ..
wget -nv https://www.openssl.org/source/openssl-1.0.2u.tar.gz
tar -xzf openssl-1.0.2u.tar.gz
cd openssl-1.0.2u
./Configure linux-x86_64 shared --prefix=/home/runner/work/yubico-piv-tool/openssl
sudo make all install VERSION="1.0.2u"

- name: Build and install
run: |
set -x
mkdir build; cd build
cmake .. -DVERBOSE_CMAKE=ON -DOPENSSL_PKG_PATH=/home/runner/work/yubico-piv-tool/openssl/lib/pkgconfig
make
make test
./tool/yubico-piv-tool --help | grep "Usage: yubico-piv-tool"
objdump -T ykcs11/libykcs11.so | grep C_Sign

ldd tool/yubico-piv-tool | grep libcrypto.so
ldd lib/libykpiv.so | grep libcrypto.so
ldd ykcs11/libykcs11.so | grep libcrypto.so

sudo make install

cd ..
LIBDIR=$(cmake -L | sed -n "s/^.*YKPIV_INSTALL_LIB_DIR:PATH=\s*\(\S*\).*$/\1/p")
sudo cp /home/runner/work/yubico-piv-tool/openssl/lib/libcrypto.* $LIBDIR/
export LD_LIBRARY_PATH=$LIBDIR
yubico-piv-tool --help | grep "Usage: yubico-piv-tool"
objdump -T $LIBDIR/libykcs11.so | grep C_Sign

job_3:
openssl_1_1_build:
name: Build with OpenSSL 1.1
runs-on: ubuntu-latest
steps:
Expand All @@ -105,9 +61,9 @@ jobs:
run: |
set -x
cd ..
wget -nv https://www.openssl.org/source/openssl-1.1.1s.tar.gz
tar -xzf openssl-1.1.1s.tar.gz
cd openssl-1.1.1s
wget -nv https://github.com/openssl/openssl/archive/refs/tags/OpenSSL_1_1_1w.tar.gz
tar -xzf OpenSSL_1_1_1w.tar.gz
cd openssl-OpenSSL_1_1_1w
./Configure linux-x86_64 shared --prefix=/home/runner/work/yubico-piv-tool/openssl
sudo make all install VERSION="1.1.1s"

Expand All @@ -134,7 +90,7 @@ jobs:
yubico-piv-tool --help | grep "Usage: yubico-piv-tool"
objdump -T $LIBDIR/libykcs11.so | grep C_Sign

job_4:
openss_3_build:
name: Build with OpenSSL 3.0
runs-on: ubuntu-latest
steps:
Expand All @@ -149,9 +105,9 @@ jobs:
run: |
set -x
cd ..
wget -nv https://www.openssl.org/source/openssl-3.0.7.tar.gz
tar -xzf openssl-3.0.7.tar.gz
cd openssl-3.0.7
wget -nv https://github.com/openssl/openssl/archive/refs/tags/openssl-3.3.1.tar.gz
tar -xzf openssl-3.3.1.tar.gz
cd openssl-openssl-3.3.1
./Configure linux-x86_64 shared --prefix=/home/runner/work/yubico-piv-tool/openssl
sudo make all install VERSION="3.0.7"

Expand Down
153 changes: 0 additions & 153 deletions .github/workflows/windows_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,159 +29,6 @@ jobs:
name: yubico-piv-tool-src
path: ../artifact

win2019_x86:
name: Windows Server 2019 - x86
needs: source_build
runs-on: windows-2019
steps:
- name: Download source from job_1
uses: actions/download-artifact@v1
with:
name: yubico-piv-tool-src

- name: Extract source
run: |
Set-PSDebug -Trace 1
cd yubico-piv-tool-src
tar xf yubico-piv-tool-.tar.gz

- name: install prerequisites for x86 architecture
run: |
Set-PSDebug -Trace 1
vcpkg install openssl:x86-windows
vcpkg install getopt:x86-windows
vcpkg install check:x86-windows
vcpkg install zlib:x86-windows

- name: build for x86 architecture
run: |
Set-PSDebug -Trace 1
$env:Path ="C:/vcpkg/packages/openssl_x86-windows;$env:Path"
$env:include ="C:/vcpkg/packages/openssl_x86-windows/include;$env:include"

cd yubico-piv-tool-src/yubico-piv-tool-
mkdir build; cd build
cmake -A Win32 -DVERBOSE_CMAKE=ON -DGETOPT_LIB_DIR=C:/vcpkg/packages/getopt-win32_x86-windows/lib -DGETOPT_INCLUDE_DIR=C:/vcpkg/packages/getopt-win32_x86-windows/include -DCHECK_PATH=C:/vcpkg/packages/check_x86-windows ..
cmake --build . -v
$env:Path +=";C:/vcpkg/packages/check_x86-windows/bin;C:/vcpkg/packages/openssl_x86-windows/bin;$env:GITHUB_WORKSPACE\yubico-piv-tool-src\yubico-piv-tool-\build\lib\Debug;$env:GITHUB_WORKSPACE\yubico-piv-tool-src\yubico-piv-tool-\build\ykcs11\Debug"
ctest.exe -C Debug

- name: Build with YKCS11_DBG is set
run: |
Set-PSDebug -Trace 1
$env:Path ="C:/vcpkg/packages/openssl_x86-windows;$env:Path"
$env:include ="C:/vcpkg/packages/openssl_x86-windows/include;$env:include"

cd yubico-piv-tool-src/yubico-piv-tool-
rm -r build; mkdir build; cd build
cmake -A Win32 -DVERBOSE_CMAKE=ON -DGETOPT_LIB_DIR=C:/vcpkg/packages/getopt-win32_x86-windows/lib -DGETOPT_INCLUDE_DIR=C:/vcpkg/packages/getopt-win32_x86-windows/include -DCHECK_PATH=C:/vcpkg/packages/check_x86-windows -DYKCS11_DBG=3 ..
cmake --build . -v
$env:Path +=";C:/vcpkg/packages/check_x86-windows/bin;C:/vcpkg/packages/openssl_x86-windows/bin;$env:GITHUB_WORKSPACE\yubico-piv-tool-src\yubico-piv-tool-\build\lib\Debug;$env:GITHUB_WORKSPACE\yubico-piv-tool-src\yubico-piv-tool-\build\ykcs11\Debug"
ctest.exe -C Debug

- name: Build only library (no CLI and no ykcs11)
run: |
Set-PSDebug -Trace 1
$env:Path ="C:/vcpkg/packages/openssl_x86-windows;$env:Path"
$env:include ="C:/vcpkg/packages/openssl_x86-windows/include;$env:include"

cd yubico-piv-tool-src/yubico-piv-tool-
rm -r build; mkdir build; cd build
cmake -A Win32 -DVERBOSE_CMAKE=ON -DGETOPT_LIB_DIR=C:/vcpkg/packages/getopt-win32_x86-windows/lib -DGETOPT_INCLUDE_DIR=C:/vcpkg/packages/getopt-win32_x86-windows/include -DCHECK_PATH=C:/vcpkg/packages/check_x86-windows -DBUILD_ONLY_LIB=ON ..
cmake --build . -v
$env:Path +=";C:/vcpkg/packages/check_x86-windows/bin;C:/vcpkg/packages/openssl_x86-windows/bin;$env:GITHUB_WORKSPACE\yubico-piv-tool-src\yubico-piv-tool-\build\lib\Debug;$env:GITHUB_WORKSPACE\yubico-piv-tool-src\yubico-piv-tool-\build\ykcs11\Debug"
ctest.exe -C Debug

- name: Build only dynamic libaries
run: |
Set-PSDebug -Trace 1
$env:Path ="C:/vcpkg/packages/openssl_x86-windows;$env:Path"
$env:include ="C:/vcpkg/packages/openssl_x86-windows/include;$env:include"

cd yubico-piv-tool-src/yubico-piv-tool-
rm -r build; mkdir build; cd build
cmake -A Win32 -DVERBOSE_CMAKE=ON -DGETOPT_LIB_DIR=C:/vcpkg/packages/getopt-win32_x86-windows/lib -DGETOPT_INCLUDE_DIR=C:/vcpkg/packages/getopt-win32_x86-windows/include -DCHECK_PATH=C:/vcpkg/packages/check_x86-windows -DBUILD_STATIC_LIB=OFF ..
cmake --build . -v
$env:Path +=";C:/vcpkg/packages/check_x86-windows/bin;C:/vcpkg/packages/openssl_x86-windows/bin;$env:GITHUB_WORKSPACE\yubico-piv-tool-src\yubico-piv-tool-\build\lib\Debug;$env:GITHUB_WORKSPACE\yubico-piv-tool-src\yubico-piv-tool-\build\ykcs11\Debug"
ctest.exe -C Debug

win2019_x64:
name: Windows Server 2019 - x64
needs: source_build
runs-on: windows-2019

steps:
- name: Download source from job_1
uses: actions/download-artifact@v1
with:
name: yubico-piv-tool-src

- name: Extract source
run: |
Set-PSDebug -Trace 1
cd yubico-piv-tool-src
tar xf yubico-piv-tool-.tar.gz

- name: install prerequisites for x64 architecture
run: |
Set-PSDebug -Trace 1
vcpkg install openssl:x64-windows
vcpkg install getopt:x64-windows
vcpkg install check:x64-windows
vcpkg install zlib:x64-windows

- name: build for x64 architecture
run: |
Set-PSDebug -Trace 1
$env:Path ="C:\vcpkg\packages\openssl_x64-windows;$env:Path"
$env:include ="C:\vcpkg\packages\openssl_x64-windows/include;$env:include"

cd yubico-piv-tool-src/yubico-piv-tool-
mkdir build; cd build
cmake -A x64 -DVERBOSE_CMAKE=ON -DBACKEND=winscard -DGETOPT_LIB_DIR=C:/vcpkg/packages/getopt-win32_x64-windows/lib -DGETOPT_INCLUDE_DIR=C:/vcpkg/packages/getopt-win32_x64-windows/include -DCHECK_PATH=C:/vcpkg/packages/check_x64-windows ..
cmake --build . -v
$env:Path +=";C:/vcpkg/packages/check_x64-windows/bin;C:/vcpkg/packages/openssl_x64-windows/bin;$env:GITHUB_WORKSPACE\yubico-piv-tool-src\yubico-piv-tool-\build\lib\Debug;$env:GITHUB_WORKSPACE\yubico-piv-tool-src\yubico-piv-tool-\build\ykcs11\Debug"
ctest.exe -C Debug

- name: Build with YKCS11_DBG is set
run: |
Set-PSDebug -Trace 1
$env:Path ="C:\vcpkg\packages\openssl_x64-windows;$env:Path"
$env:include ="C:\vcpkg\packages\openssl_x64-windows/include;$env:include"

cd yubico-piv-tool-src/yubico-piv-tool-
rm -r build; mkdir build; cd build
cmake -A x64 -DVERBOSE_CMAKE=ON -DBACKEND=winscard -DGETOPT_LIB_DIR=C:/vcpkg/packages/getopt-win32_x64-windows/lib -DGETOPT_INCLUDE_DIR=C:/vcpkg/packages/getopt-win32_x64-windows/include -DCHECK_PATH=C:/vcpkg/packages/check_x64-windows -DYKCS11_DBG=3 ..
cmake --build . -v
$env:Path +=";C:/vcpkg/packages/check_x64-windows/bin;C:/vcpkg/packages/openssl_x64-windows/bin;$env:GITHUB_WORKSPACE\yubico-piv-tool-src\yubico-piv-tool-\build\lib\Debug;$env:GITHUB_WORKSPACE\yubico-piv-tool-src\yubico-piv-tool-\build\ykcs11\Debug"
ctest.exe -C Debug

- name: Build only library (no CLI and no ykcs11)
run: |
Set-PSDebug -Trace 1
$env:Path ="C:\vcpkg\packages\openssl_x64-windows;$env:Path"
$env:include ="C:\vcpkg\packages\openssl_x64-windows/include;$env:include"

cd yubico-piv-tool-src/yubico-piv-tool-
rm -r build; mkdir build; cd build
cmake -A x64 -DVERBOSE_CMAKE=ON -DBACKEND=winscard -DGETOPT_LIB_DIR=C:/vcpkg/packages/getopt-win32_x64-windows/lib -DGETOPT_INCLUDE_DIR=C:/vcpkg/packages/getopt-win32_x64-windows/include -DCHECK_PATH=C:/vcpkg/packages/check_x64-windows -DBUILD_ONLY_LIB=ON ..
cmake --build . -v
$env:Path +=";C:/vcpkg/packages/check_x64-windows/bin;C:/vcpkg/packages/openssl_x64-windows/bin;$env:GITHUB_WORKSPACE\yubico-piv-tool-src\yubico-piv-tool-\build\lib\Debug;$env:GITHUB_WORKSPACE\yubico-piv-tool-src\yubico-piv-tool-\build\ykcs11\Debug"
ctest.exe -C Debug

- name: Build only dynamic libaries
run: |
Set-PSDebug -Trace 1
$env:Path ="C:\vcpkg\packages\openssl_x64-windows;$env:Path"
$env:include ="C:\vcpkg\packages\openssl_x64-windows/include;$env:include"

cd yubico-piv-tool-src/yubico-piv-tool-
rm -r build; mkdir build; cd build
cmake -A x64 -DVERBOSE_CMAKE=ON -DBACKEND=winscard -DGETOPT_LIB_DIR=C:/vcpkg/packages/getopt-win32_x64-windows/lib -DGETOPT_INCLUDE_DIR=C:/vcpkg/packages/getopt-win32_x64-windows/include -DCHECK_PATH=C:/vcpkg/packages/check_x64-windows -DBUILD_STATIC_LIB=OFF ..
cmake --build . -v
$env:Path +=";C:/vcpkg/packages/check_x64-windows/bin;C:/vcpkg/packages/openssl_x64-windows/bin;$env:GITHUB_WORKSPACE\yubico-piv-tool-src\yubico-piv-tool-\build\lib\Debug;$env:GITHUB_WORKSPACE\yubico-piv-tool-src\yubico-piv-tool-\build\ykcs11\Debug"
ctest.exe -C Debug

build:
name: Build and Test on Windows
needs: source_build
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/windows_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ jobs:
Set-PSDebug -Trace 1
cd "$env:GITHUB_WORKSPACE\yubico-piv-tool-src\yubico-piv-tool-$env:RELEASE_VERSION\resources\win"
msiexec /i yubico-piv-tool-$env:RELEASE_VERSION-x86.msi /quiet /log $env:GITHUB_WORKSPACE/artifact/log_x86.txt
Start-Sleep -s 5

- name: Upload artifact
uses: actions/upload-artifact@v1
Expand Down
Loading