-
Notifications
You must be signed in to change notification settings - Fork 28
57 lines (48 loc) · 1.86 KB
/
main.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
name: CI
on: [push, pull_request, workflow_dispatch]
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
buildtype: [Debug, RelWithDebInfo]
version: ['1.00', '1.10f', '1.14d']
exclude: # Build release only for unmaintained versions.
- buildtype: Debug
version: '1.14d'
- buildtype: Debug
version: '1.00'
env:
BUILD_TYPE: ${{ matrix.buildtype }}
CMAKE_PRESET: ${{ matrix.buildtype == 'Debug' && 'clang-tidy' || 'ninja' }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
# Find the clang-tidy bundled with MSVC
- name: Add clang-tidy to PATH
if: env.BUILD_TYPE == 'Debug'
uses: Lectem/[email protected]
with: {file: 'VC\Tools\Llvm\bin\clang-tidy.exe'}
# We need to start cmake from vcvarsall env so that Ninja will pick MSVC
- uses: ilammy/msvc-dev-cmd@v1
with: {arch: x86}
- name: CMake configure and build
run: |
cmake --preset ${{env.CMAKE_PRESET}} -DD2MOO_ORDINALS_VERSION="${{matrix.version}}"
cmake --build --preset ${{env.CMAKE_PRESET}} --config ${{env.BUILD_TYPE}}
env: # We need to enforce VC++ here as clang is picked otherwise due to clang-tidy being in the path
CXX: CL
CC: CL
- name: Test
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest --preset ${{env.CMAKE_PRESET}} -C ${{env.BUILD_TYPE}}
- name: Install
if: env.BUILD_TYPE == 'RelWithDebInfo'
run: cmake --build --preset ${{env.CMAKE_PRESET}} --config ${{env.BUILD_TYPE}} --target install
- name: Artifact
if: env.BUILD_TYPE == 'RelWithDebInfo'
uses: actions/upload-artifact@v3
with:
path: '${{github.workspace}}\out\install\${{env.CMAKE_PRESET}}\'