|
66 | 66 | |
67 | 67 | - name: Install dependencies (Windows) |
68 | 68 | if: matrix.os == 'windows-latest' |
| 69 | + shell: pwsh |
69 | 70 | run: | |
70 | 71 | choco install cmake ninja pkgconfiglite |
71 | | - vcpkg install libsodium:x64-windows pkgconf:x64-windows |
| 72 | + vcpkg install libsodium:x64-windows pkgconf:x64-windows gtest:x64-windows |
72 | 73 | echo "CMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" >> $env:GITHUB_ENV |
73 | 74 | echo "PKG_CONFIG_PATH=C:/vcpkg/installed/x64-windows/lib/pkgconfig" >> $env:GITHUB_ENV |
74 | 75 | if ("${{ matrix.compiler }}" -eq "msvc") { |
@@ -96,38 +97,47 @@ jobs: |
96 | 97 | cmake --build . --config ${{ matrix.build-type }} |
97 | 98 | sudo cmake --install . --config ${{ matrix.build-type }} |
98 | 99 | |
99 | | - - name: Install Google Test (Windows) |
| 100 | + - name: Configure CMake (Windows) |
100 | 101 | if: matrix.os == 'windows-latest' |
| 102 | + shell: pwsh |
101 | 103 | run: | |
102 | | - git clone https://github.com/google/googletest.git |
103 | | - cd googletest |
| 104 | + cd cpp_sdk |
104 | 105 | mkdir build && cd build |
105 | | - cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_TOOLCHAIN_FILE=$env:CMAKE_TOOLCHAIN_FILE |
106 | | - cmake --build . --config ${{ matrix.build-type }} |
107 | | - cmake --install . --config ${{ matrix.build-type }} |
| 106 | + if ("${{ matrix.compiler }}" -eq "msvc") { |
| 107 | + cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DENABLE_SANITIZERS=ON -DCMAKE_TOOLCHAIN_FILE="${{ env.CMAKE_TOOLCHAIN_FILE }}" |
| 108 | + } else { |
| 109 | + cmake .. -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DENABLE_SANITIZERS=ON -DCMAKE_TOOLCHAIN_FILE="${{ env.CMAKE_TOOLCHAIN_FILE }}" |
| 110 | + } |
| 111 | + env: |
| 112 | + CI: true |
108 | 113 |
|
109 | | - - name: Configure CMake |
| 114 | + - name: Configure CMake (Unix) |
| 115 | + if: matrix.os != 'windows-latest' |
| 116 | + shell: bash |
110 | 117 | run: | |
111 | 118 | cd cpp_sdk |
112 | 119 | mkdir build && cd build |
113 | | - if [[ "${{ matrix.compiler }}" == "msvc" ]]; then |
114 | | - cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DENABLE_SANITIZERS=ON -DCMAKE_TOOLCHAIN_FILE=${{ env.CMAKE_TOOLCHAIN_FILE }} |
115 | | - else |
116 | | - cmake .. -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DENABLE_SANITIZERS=ON |
117 | | - fi |
118 | | - shell: bash |
| 120 | + cmake .. -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DENABLE_SANITIZERS=ON |
119 | 121 | env: |
120 | 122 | CI: true |
121 | 123 |
|
122 | | - - name: Build |
| 124 | + - name: Build (Windows) |
| 125 | + if: matrix.os == 'windows-latest' |
| 126 | + shell: pwsh |
123 | 127 | run: | |
124 | 128 | cd cpp_sdk/build |
125 | | - if [[ "${{ matrix.compiler }}" == "msvc" ]]; then |
| 129 | + if ("${{ matrix.compiler }}" -eq "msvc") { |
126 | 130 | cmake --build . --config ${{ matrix.build-type }} |
127 | | - else |
| 131 | + } else { |
128 | 132 | ninja |
129 | | - fi |
| 133 | + } |
| 134 | + |
| 135 | + - name: Build (Unix) |
| 136 | + if: matrix.os != 'windows-latest' |
130 | 137 | shell: bash |
| 138 | + run: | |
| 139 | + cd cpp_sdk/build |
| 140 | + ninja |
131 | 141 | |
132 | 142 | - name: Run tests |
133 | 143 | run: | |
|
0 commit comments