Skip to content

Commit

Permalink
Added npcap to GH Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianReimold committed Mar 4, 2024
1 parent 3877127 commit c11abee
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ jobs:

strategy:
matrix:
library_type: [static, shared, object]
build_arch: [x64, win32]
library_type: [static, shared, object]
build_arch: [x64, win32]
npcap_enabled: [ON, OFF]

# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
Expand All @@ -31,23 +32,29 @@ jobs:
run: |
if ( '${{ matrix.library_type }}' -eq 'static' )
{
echo "build_shared_libs=OFF" >> "$Env:GITHUB_ENV"
echo "ecaludp_library_type=STATIC" >> "$Env:GITHUB_ENV"
echo "package_postfix=static" >> "$Env:GITHUB_ENV"
}
elseif( '${{ matrix.library_type }}' -eq 'shared' )
{
echo "build_shared_libs=ON" >> "$Env:GITHUB_ENV"
echo "ecaludp_library_type=SHARED" >> "$Env:GITHUB_ENV"
echo "package_postfix=shared" >> "$Env:GITHUB_ENV"
}
elseif( '${{ matrix.library_type }}' -eq 'object' )
{
echo "build_shared_libs=OFF" >> "$Env:GITHUB_ENV"
echo "ecaludp_library_type=OBJECT" >> "$Env:GITHUB_ENV"
echo "package_postfix=object" >> "$Env:GITHUB_ENV"
}
if ( '${{ matrix.npcap_enabled }}' -eq 'ON' )
{
echo "npcap_enabled_string=-npcap" >> "$Env:GITHUB_ENV"
}
else
{
echo "npcap_enabled_string=" >> "$Env:GITHUB_ENV"
}
- name: Checkout
uses: actions/checkout@v3
with:
Expand All @@ -73,8 +80,8 @@ jobs:
-DECALUDP_USE_BUILTIN_RECYCLE=ON ^
-DECALUDP_USE_BUILTIN_GTEST=ON ^
-DECALUDP_LIBRARY_TYPE=${{env.ecaludp_library_type}} ^
-DCMAKE_INSTALL_PREFIX=${{env.INSTALL_PREFIX}} ^
-DBUILD_SHARED_LIBS=${{ env.build_shared_libs }}
-DECALUDP_ENABLE_NPCAP=${{ matrix.npcap_enabled }} ^
-DCMAKE_INSTALL_PREFIX=${{env.INSTALL_PREFIX}}
- name: Build (Release)
shell: cmd
Expand All @@ -101,6 +108,7 @@ jobs:
- name: Run Tests
run: ctest -C Release -V
working-directory: ${{ github.workspace }}/_build
if: ${{ matrix.npcap_enabled != 'ON' }} # Npcap driver is missing, so we cannot execute tests

- name: Read Project Version from CMakeCache
run: |
Expand All @@ -111,7 +119,7 @@ jobs:
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
name: ${{ env.PROJECT_NAME }}-${{ env.CMAKE_PROJECT_VERSION }}-windows-${{ matrix.build_arch }}-${{ env.VS_NAME }}-${{ matrix.library_type }}
name: ${{ env.PROJECT_NAME }}-${{ env.CMAKE_PROJECT_VERSION }}${{ env.npcap_enabled_string }}-windows-${{ matrix.build_arch }}-${{ env.VS_NAME }}-${{ matrix.library_type }}
path: ${{github.workspace}}/${{env.INSTALL_PREFIX}}
if: ${{ matrix.library_type != 'object' }}

Expand Down

0 comments on commit c11abee

Please sign in to comment.