-
Notifications
You must be signed in to change notification settings - Fork 31
91 lines (78 loc) · 2.71 KB
/
windows-builds.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: windows-builds
on: workflow_call
env:
CMAKE_VERSION: 3.21.1
NINJA_VERSION: 1.11.1
CCACHE_VERSION: 4.8
jobs:
dev-build:
runs-on: windows-latest
strategy:
matrix:
generator: ['Ninja', 'NMake Makefiles', 'Visual Studio 17 2022']
build_type: [Debug, Release]
include:
- build_type: Debug
examples: ON
tests: OFF # the template asap has no unit tests
- build_type: Release
examples: ON
tests: OFF # the template asap has no unit tests
steps:
- name: Setup ninja (only if the generator is 'Ninja')
if: matrix.generator == 'Ninja'
uses: abdes/gha-setup-ninja@master
with:
version: ${{ env.NINJA_VERSION }}
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: ${{ env.CMAKE_VERSION }}
- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1
with:
install_ccache: true
update_packager_index: false
prepend_symlinks_to_path: false
windows_compile_environment: msvc # this field is required
- name: Set MSVC environment
uses: ilammy/msvc-dev-cmd@v1
- name: Log environment properties
run: |
echo "Build Type : ${{matrix.build_type}}"
echo "Generator : ${{matrix.generator}}"
if ('${{matrix.generator}}' -eq 'Ninja') {
ninja --version
}
cmake --version
ccache --version
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Configure build
working-directory: ${{runner.workspace}}
run: |
cmake -B build -S asap_app_imgui `
-D CMAKE_BUILD_TYPE=${{matrix.build_type}} `
-G "${{ matrix.generator }}" `
-D USE_CCACHE=ON `
-D ASAP_BUILD_TESTS=${{matrix.tests}} `
-D ASAP_BUILD_EXAMPLES=${{matrix.examples}} `
-D ASAP_BUILD_DOCS=OFF `
-D CMAKE_INSTALL_PREFIX=install `
-D CMAKE_VERBOSE_MAKEFILE=ON
dir build
- name: Build main targets
working-directory: ${{runner.workspace}}
run: |
cmake --build build --config ${{matrix.build_type}}
- name: Build test targets
working-directory: ${{runner.workspace}}
if: matrix.tests == true
run: |
cmake --build build --config ${{matrix.build_type}} --target build-all-tests
- name: Run tests with ctest
working-directory: ${{runner.workspace}}
# Hardcode 2 cores we know are there
run: |
ctest --test-dir build -C ${{matrix.build_type}} -j 2 --output-on-failure