-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (51 loc) · 1.37 KB
/
cmake.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
name: CMake Build and Test
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
check-format:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build clang-format
- name: Configure CMake
run: cmake --preset ninja
- name: Check format
run: cmake --build --preset ninja --target clang-format-check
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
cmake_preset: ninja
- os: windows-latest
cmake_preset: msvc22
- os: macos-latest
cmake_preset: xcode
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build
- name: Configure CMake
run: |
cmake --preset ${{ matrix.cmake_preset }}
- name: Build
run: |
cmake --build --preset ${{ matrix.cmake_preset }}
- name: Test
run: |
ctest --preset ${{ matrix.cmake_preset }} --output-on-failure