-
Notifications
You must be signed in to change notification settings - Fork 34
60 lines (53 loc) · 1.39 KB
/
build.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
name: build
on:
pull_request:
release:
types: [published]
push:
tags:
branches:
- master
jobs:
Test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-latest
generator:
- "Visual Studio 17 2022"
arch:
- x64
- Win32
build_type:
- Release
- Debug
compiler:
- msvc
package_generator:
- ZIP
steps:
- uses: actions/checkout@v2
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
vcvarsall: ${{ contains(matrix.os, 'windows' )}}
cmake: true
ninja: true
- name: Configure CMake
run: |
cmake -S . -B ./build -G "${{matrix.generator}}" -A "${{matrix.arch}}" -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}}
- name: Build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
cmake --build ./build --config ${{matrix.build_type}}
- name: Test
run: |
ctest --build-and-test . ./build --build-generator "${{matrix.generator}}"
- name: CPack
if: matrix.build_type == 'Release'
working-directory: ./build
run: |
cpack -C ${{matrix.build_type}} -G ${{matrix.package_generator}}