-
Notifications
You must be signed in to change notification settings - Fork 16
69 lines (54 loc) · 1.58 KB
/
UnitTest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Unit Test
on:
workflow_dispatch:
pull_request:
branches: [ master ]
jobs:
build:
strategy:
matrix:
targetplatform: [x86, x64]
runs-on: windows-latest
env:
VCPKG_ROOT: '${{ github.workspace }}\vcpkg'
steps:
- name: Checkout
uses: actions/checkout@v1
with:
submodules: recursive
- name: Setup Windows 10 SDK
uses: GuillaumeFalourd/setup-windows10-sdk-action@v1
with:
sdk-version: 19041
- name: Get cmake
# Install latest CMake.
uses: lukka/get-cmake@latest
- name: Restore vcpkg and its artifacts.
uses: actions/cache@v2
id: vcpkg-cache
with:
path: |
${{ env.VCPKG_ROOT }}
${{ github.workspace }}\build\vcpkg_installed
key: |
${{ hashFiles( 'vcpkg.json' ) }}-${{ runner.os }}-cache-key-v1
- name: Installing vcpkg (windows)
run: |
cd ${{ github.workspace }}
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
.\bootstrap-vcpkg.bat
- name: Generate make file
run: |
cd ${{ github.workspace }}
mkdir build
cmake -B ./build -G "Visual Studio 16 2019" -A x64 -DVCPKG_PATH=${{ env.VCPKG_ROOT }} -DCMAKE_SYSTEM_VERSION=10.0.19041.0 -S . -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}\scripts\buildsystems\vcpkg.cmake
- name: Build Solution
run: |
cd ${{ github.workspace }}
cmake --build build
- name: Run CTest
run: |
cd ${{ github.workspace }}
cd build
ctest