From 04a9aa09e18a8056174daf537c46fb89dc42f4a1 Mon Sep 17 00:00:00 2001 From: Maxim Samsonov Date: Sat, 18 Nov 2023 01:34:21 +0300 Subject: [PATCH] Windows native build with sanitizers (5) --- .github/workflows/windows-native.yml | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/.github/workflows/windows-native.yml b/.github/workflows/windows-native.yml index 9ed21184b..ab85c801b 100644 --- a/.github/workflows/windows-native.yml +++ b/.github/workflows/windows-native.yml @@ -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: @@ -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 @@ -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 . @@ -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 @@ -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"