-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (53 loc) · 1.87 KB
/
ci.yml
File metadata and controls
65 lines (53 loc) · 1.87 KB
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
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
# Cancel an in-progress run for the same ref when a new push arrives.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
# ---------------------------------------------------------------------------
# Build & Test matrix: MSVC Debug/Release + Clang-cl Debug/Release
# ---------------------------------------------------------------------------
build:
name: Build & Test (${{ matrix.preset }})
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
preset:
- x64-debug
- x64-release
- x64-debug-clang
- x64-release-clang
steps:
- name: Checkout
uses: actions/checkout@v4
# Puts cl.exe / clang-cl.exe and the Windows SDK headers in PATH / env.
- name: Set up MSVC developer environment
uses: ilammy/msvc-dev-cmd@v1
- name: Configure
run: cmake --preset ${{ matrix.preset }}
- name: Build
run: cmake --build --preset ${{ matrix.preset }}
# Ninja is a single-config generator, so -C <config> is not required.
- name: Test
run: ctest --test-dir build/${{ matrix.preset }} --output-on-failure
# ---------------------------------------------------------------------------
# clang-format: fail if any source file is not already correctly formatted.
# No reformatting is performed; the working tree is left untouched.
# ---------------------------------------------------------------------------
clang-format:
name: clang-format
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check formatting
shell: bash
run: |
find src tests \( -name "*.cpp" -o -name "*.h" \) -print0 \
| xargs -0 clang-format --dry-run --Werror