Skip to content

Commit

Permalink
Windows native build with sanitizers (5)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxirmx committed Nov 17, 2023
1 parent 30d4c1b commit 04a9aa0
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions .github/workflows/windows-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ env:

jobs:
build_and_test:
name: Windows-2019 [arch ${{ matrix.arch.name }}, toolset ${{ matrix.toolset }}, backend ${{ matrix.backend }}, build shared libs ${{ matrix.shared_libs }}, use CMake prefix path ${{ matrix.use_cmake_prefix_path }}, sanitizers ${{ matrix.build_mode.sanitizers }}]
name: Windows-2019 [arch ${{ matrix.arch.name }}, toolset ${{ matrix.toolset }}, backend ${{ matrix.backend }}, build shared libs ${{ matrix.shared_libs }}, use CMake prefix path ${{ matrix.use_cmake_prefix_path }}, sanitizers ${{ matrix.sanitizers }}]
runs-on: windows-2019
if: "!contains(github.event.head_commit.message, 'skip ci')"
strategy:
Expand All @@ -74,26 +74,26 @@ jobs:
backend: [ 'botan', 'openssl' ]
shared_libs: [ 'off']
use_cmake_prefix_path: [ 'on', 'off' ]
build_mode: [{ sanitizers: 'off', build_type: 'Release', path_suffix: '' }]
sanitizers: [ 'on' ]
include:
- arch: { name: 'x64', triplet: 'x64-windows' }
toolset: 'v142'
backend: 'botan'
use_cmake_prefix_path: 'off'
shared_libs: 'off'
build_mode: { sanitizers: 'on', build_type: 'Debug', path_suffix: '/debug' }
sanitizers: 'on'
- arch: { name: 'Win32', triplet: 'x86-windows' }
toolset: 'ClangCL'
backend: 'botan'
use_cmake_prefix_path: 'on'
shared_libs: 'off'
build_mode: { sanitizers: 'off', build_type: 'Release', path_suffix: '' }
sanitizers: 'off'
- arch: { name: 'Win32', triplet: 'x86-windows' }
toolset: 'v142'
backend: 'openssl'
use_cmake_prefix_path: 'off'
shared_libs: 'off'
build_mode: { sanitizers: 'off', build_type: 'Release', path_suffix: '' }
sanitizers: 'off'

steps:
- name: Checkout
Expand Down Expand Up @@ -144,13 +144,12 @@ jobs:
shell: bash
run: |
echo CORES="$(nproc --all)" >> $GITHUB_ENV
export PATH=${{ env.VCPKG_DIR_U }}/installed/${{ matrix.arch.triplet }}${{ matrix.build_mode.path_prefix }}/bin:$PATH
export PATH=${{ env.VCPKG_DIR_U }}/installed/${{ matrix.arch.triplet }}/bin:$PATH
cmake -B build -G "Visual Studio 16 2019" \
-A ${{ matrix.arch.name }} \
-T ${{ matrix.toolset }} \
-DBUILD_SHARED_LIBS=${{ matrix.shared_libs}} \
-DENABLE_SANITIZERS=${{ matrix.build_mode.sanitizers }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_mode.build_type }} \
-DENABLE_SANITIZERS=${{ matrix.sanitizers }} \
-DCRYPTO_BACKEND=${{ matrix.backend }} \
-DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_DIR }}/scripts/buildsystems/vcpkg.cmake .
Expand All @@ -159,21 +158,20 @@ jobs:
shell: bash
run: |
echo CORES="$(nproc --all)" >> $GITHUB_ENV
export PATH=${{ env.VCPKG_DIR_U }}/installed/${{ matrix.arch.triplet }}${{ matrix.build_mode.path_prefix }}/bin:$PATH
export PATH=${{ env.VCPKG_DIR_U }}/installed/${{ matrix.arch.triplet }}/bin:$PATH
cmake -B build -G "Visual Studio 16 2019" \
-A ${{ matrix.arch.name }} \
-T ${{ matrix.toolset }} \
-DBUILD_SHARED_LIBS=${{ matrix.shared_libs}} \
-DENABLE_SANITIZERS=${{ matrix.build_mode.sanitizers }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_mode.build_type }} \
-DENABLE_SANITIZERS=${{ matrix.sanitizers }} \
-DCRYPTO_BACKEND=${{ matrix.backend }} \
-DCMAKE_PREFIX_PATH=${{ env.VCPKG_DIR }}/installed/${{ matrix.arch.triplet }} .
- name: Build
shell: bash
run: |
export PATH=${{ env.VCPKG_DIR_U }}/installed/${{ matrix.arch.triplet }}${{ matrix.build_mode.path_prefix }}/bin:$PATH
cmake --build build --parallel ${{ env.CORES }} --config ${{ matrix.build_mode.build_type }}
export PATH=${{ env.VCPKG_DIR_U }}/installed/${{ matrix.arch.triplet }}/bin:$PATH
cmake --build build --parallel ${{ env.CORES }} --config Release
- name: Test
shell: bash
Expand All @@ -182,10 +180,10 @@ jobs:
# ctest --parallel ${{ env.CORES }} --test-dir build -R rnp_tests -C Debug --output-on-failure
# ctest --parallel ${{ env.CORES }} --test-dir build -C Release --output-on-failure
run: |
export PATH=${{ env.VCPKG_DIR_U }}/installed/${{ matrix.arch.triplet }}${{ matrix.build_mode.path_prefix }}/bin:$PATH
export PATH=${{ env.VCPKG_DIR_U }}/installed/${{ matrix.arch.triplet }}/bin:$PATH
mkdir -p "build/Testing/Temporary"
cp "cmake/CTestCostData.txt" "build/Testing/Temporary"
ctest --parallel ${{ env.CORES }} --test-dir build -C ${{ matrix.build_mode.build_type }} --output-on-failure
ctest --parallel ${{ env.CORES }} --test-dir build -C Release --output-on-failure
# Local build hints:
# cmd /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
Expand Down

0 comments on commit 04a9aa0

Please sign in to comment.