Skip to content

Commit

Permalink
githubactions: update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
aveenismail committed Nov 30, 2023
1 parent 2f81980 commit 5b875e1
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 118 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/macos_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
RELEASE_VERSION: 2.3.1
steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install prerequisites
run: |
Expand All @@ -22,14 +22,13 @@ jobs:
run: |
set -x
./resources/make_src_dist.sh $RELEASE_VERSION
cd ..
mkdir artifact
mv $GITHUB_WORKSPACE/yubico-piv-tool-$RELEASE_VERSION.tar.gz artifact/
mkdir $GITHUB_WORKSPACE/artifact
mv $GITHUB_WORKSPACE/yubico-piv-tool-$RELEASE_VERSION.tar.gz $GITHUB_WORKSPACE/artifact/
- name: Upload artifact
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: yubico-piv-tool-src
path: ../artifact
path: artifact

job_2:
name: Build pkg from source
Expand Down
178 changes: 66 additions & 112 deletions .github/workflows/windows_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ on: [push]

jobs:

souce_build:
souce:
name: Build dist with Linux
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install prerequisites
run: |
Expand All @@ -20,22 +20,37 @@ jobs:
run: |
set -x
./resources/make_src_dist.sh
cd ..
mkdir artifact
mv $GITHUB_WORKSPACE/yubico-piv-tool-.tar.gz artifact/
mkdir $GITHUB_WORKSPACE/artifact
mv $GITHUB_WORKSPACE/yubico-piv-tool-.tar.gz $GITHUB_WORKSPACE/artifact/
- name: Upload artifact
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: yubico-piv-tool-src
path: ../artifact

win2019_x86:
name: Windows Server 2019 - x86
needs: souce_build
runs-on: windows-2019
path: artifact

build:
name: Build and Test on Windows
needs: souce
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 job_1
uses: actions/download-artifact@v1
- name: Download source from source
uses: actions/download-artifact@v3
with:
name: yubico-piv-tool-src

Expand All @@ -45,137 +60,76 @@ jobs:
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
- 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)
- name: install prerequisites
env:
ARCH_CMAKE: ${{ matrix.arch_cmake }}
ARCH: ${{ matrix.arch }}
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: souce_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
- name: build for x64 architecture
vcpkg install openssl:$env:ARCH-windows
vcpkg install getopt:$env:ARCH-windows
vcpkg install check:$env:ARCH-windows
- name: build binaries
env:
ARCH_CMAKE: ${{ matrix.arch_cmake }}
ARCH: ${{ matrix.arch }}
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"
$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-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 -A $env:ARCH_CMAKE -DVERBOSE_CMAKE=ON -DGETOPT_LIB_DIR=C:/vcpkg/packages/getopt-$env:ARCH_CMAKE_$env:ARCH-windows/lib -DGETOPT_INCLUDE_DIR=C:/vcpkg/packages/getopt-$env:ARCH_CMAKE_$env:ARCH-windows/include -DCHECK_PATH=C:/vcpkg/packages/check_$env:ARCH-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"
$env:Path +=";C:/vcpkg/packages/check_$env:ARCH-windows/bin;C:/vcpkg/packages/openssl_$env:ARCH-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
env:
ARCH_CMAKE: ${{ matrix.arch_cmake }}
ARCH: ${{ matrix.arch }}
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"
$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-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 -A $env:ARCH_CMAKE -DVERBOSE_CMAKE=ON -DGETOPT_LIB_DIR=C:/vcpkg/packages/getopt-$env:ARCH_CMAKE_$env:ARCH-windows/lib -DGETOPT_INCLUDE_DIR=C:/vcpkg/packages/getopt-$env:ARCH_CMAKE_$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_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"
$env:Path +=";C:/vcpkg/packages/check_$env:ARCH-windows/bin;C:/vcpkg/packages/openssl_$env:ARCH-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)
env:
ARCH_CMAKE: ${{ matrix.arch_cmake }}
ARCH: ${{ matrix.arch }}
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"
$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-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 -A $env:ARCH_CMAKE -DVERBOSE_CMAKE=ON -DGETOPT_LIB_DIR=C:/vcpkg/packages/getopt-$env:ARCH_CMAKE_$env:ARCH-windows/lib -DGETOPT_INCLUDE_DIR=C:/vcpkg/packages/getopt-$env:ARCH_CMAKE_$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_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"
$env:Path +=";C:/vcpkg/packages/check_$env:ARCH-windows/bin;C:/vcpkg/packages/openssl_$env:ARCH-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
env:
ARCH_CMAKE: ${{ matrix.arch_cmake }}
ARCH: ${{ matrix.arch }}
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"
$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-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 -A $env:ARCH_CMAKE -DVERBOSE_CMAKE=ON -DGETOPT_LIB_DIR=C:/vcpkg/packages/getopt-$env:ARCH_CMAKE_$env:ARCH-windows/lib -DGETOPT_INCLUDE_DIR=C:/vcpkg/packages/getopt-$env:ARCH_CMAKE_$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_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"
$env:Path +=";C:/vcpkg/packages/check_$env:ARCH-windows/bin;C:/vcpkg/packages/openssl_$env:ARCH-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
1 change: 1 addition & 0 deletions cmake/check.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ macro (find_check)
if(NOT check_FOUND)
find_package(check CONFIG PATHS ${CHECK_PATH})
if(check_FOUND)
message(WARNING "------------------ 'check' found.")
set(LIBCHECK_LDFLAGS Check::check Check::checkShared)
set(LIBCHECK_INCLUDE_DIRS ${CHECK_INCLUDE_DIR})
set(LIBCHECK_VERSION ${CHECK_VERSION})
Expand Down

0 comments on commit 5b875e1

Please sign in to comment.