Skip to content

Commit

Permalink
CI: Update windows runner to windows-2022
Browse files Browse the repository at this point in the history
  • Loading branch information
ni4 committed Aug 21, 2024
1 parent 53a1833 commit 216fd43
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions .github/workflows/windows-native.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2023 Ribose Inc.
# Copyright (c) 2023-2024 Ribose Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -65,21 +65,21 @@ 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.sanitizers }}]
runs-on: windows-2019
name: Windows-2022 [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-2022
if: "!contains(github.event.head_commit.message, 'skip ci')"
strategy:
fail-fast: false
matrix:
arch: [ { name: 'x64', triplet: 'x64-windows' } ]
toolset: [ 'v142', 'ClangCL' ]
toolset: [ 'v143', 'ClangCL' ]
backend: [ 'botan', 'openssl' ]
shared_libs: [ 'off']
use_cmake_prefix_path: [ 'on', 'off' ]
sanitizers: [ 'off' ]
include:
- arch: { name: 'x64', triplet: 'x64-windows' }
toolset: 'v142'
toolset: 'v143'
backend: 'botan'
use_cmake_prefix_path: 'off'
shared_libs: 'off'
Expand All @@ -91,7 +91,7 @@ jobs:
shared_libs: 'off'
sanitizers: 'off'
- arch: { name: 'Win32', triplet: 'x86-windows' }
toolset: 'v142'
toolset: 'v143'
backend: 'openssl'
use_cmake_prefix_path: 'off'
shared_libs: 'off'
Expand Down Expand Up @@ -157,12 +157,12 @@ jobs:
run: |
echo CORES="$(nproc --all)" >> $GITHUB_ENV
export PATH=${{ env.VCPKG_DIR_U }}/installed/${{ matrix.arch.triplet }}/bin:$PATH
cmake -B build -G "Visual Studio 16 2019" \
cmake -B build -G "Visual Studio 17 2022" \
-A ${{ matrix.arch.name }} \
-T ${{ matrix.toolset }} \
-DBUILD_SHARED_LIBS=${{ matrix.shared_libs}} \
-DBUILD_SHARED_LIBS=${{ matrix.shared_libs}} \
-DENABLE_SANITIZERS=${{ matrix.sanitizers }} \
-DCRYPTO_BACKEND=${{ matrix.backend }} \
-DCRYPTO_BACKEND=${{ matrix.backend }} \
-DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_DIR }}/scripts/buildsystems/vcpkg.cmake .
- name: Configure using CMake prefix path
Expand All @@ -171,19 +171,24 @@ jobs:
run: |
echo CORES="$(nproc --all)" >> $GITHUB_ENV
export PATH=${{ env.VCPKG_DIR_U }}/installed/${{ matrix.arch.triplet }}/bin:$PATH
cmake -B build -G "Visual Studio 16 2019" \
cmake -B build -G "Visual Studio 17 2022" \
-A ${{ matrix.arch.name }} \
-T ${{ matrix.toolset }} \
-DBUILD_SHARED_LIBS=${{ matrix.shared_libs}} \
-DBUILD_SHARED_LIBS=${{ matrix.shared_libs}} \
-DENABLE_SANITIZERS=${{ matrix.sanitizers }} \
-DCRYPTO_BACKEND=${{ matrix.backend }} \
-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 }}/bin:$PATH
cmake --build build --parallel ${{ env.CORES }} --config Release
config=Release
if [[ "${{ matrix.sanitizers }}" == "on" ]]; then
# It is recommended to use Debug config with sanitizers
config=Debug
fi
cmake --build build --parallel ${{ env.CORES }} --config $config
- name: Test
shell: bash
Expand All @@ -193,6 +198,11 @@ jobs:
# ctest --parallel ${{ env.CORES }} --test-dir build -C Release --output-on-failure
run: |
export PATH=${{ env.VCPKG_DIR_U }}/installed/${{ matrix.arch.triplet }}/bin:$PATH
if [[ "${{ matrix.sanitizers }}" == "on" ]]; then
# Since VS 2022 we need to add path to sanitizers lib to PATH to load it. Currently it is hardcoded for toolset v143.
lib_dir=$(cygpath -u "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.40.33807\bin\Hostx64\x64")
export PATH=$lib_dir:$PATH
fi
mkdir -p "build/Testing/Temporary"
cp "cmake/CTestCostData.txt" "build/Testing/Temporary"
ctest --parallel ${{ env.CORES }} --test-dir build -C Release --output-on-failure

0 comments on commit 216fd43

Please sign in to comment.