-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (103 loc) · 3.32 KB
/
ci.yml
File metadata and controls
133 lines (103 loc) · 3.32 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
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# Auto-generated from cpp-library (https://github.com/stlab/cpp-library)
# Do not edit this file directly - it will be overwritten when templates are regenerated
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
release:
types: [published]
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
compiler: [gcc, clang, msvc]
exclude:
- os: ubuntu-latest
compiler: msvc
- os: macos-latest
compiler: msvc
- os: macos-latest
compiler: gcc
- os: windows-latest
compiler: gcc
- os: windows-latest
compiler: clang
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- name: Configure CMake
run: cmake --preset=test
- name: Build
run: cmake --build --preset=test
- name: Test
run: ctest --preset=test
install-test:
name: Test Installation (${{ matrix.os }})
runs-on: ${{ matrix.os }}
needs: test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v5
- name: Build and Install
run: |
cmake --preset=default
cmake --build --preset=default
cmake --install build/default --prefix ${{ runner.temp }}/install
- name: Test find_package
shell: bash
run: |
# Create a minimal test to verify the installation works with find_package
mkdir -p ${{ runner.temp }}/test-find-package
cd ${{ runner.temp }}/test-find-package
# Get project name from CMakeLists.txt
THIS_PROJECT_NAME=$(grep -m1 "project(" ${{ github.workspace }}/CMakeLists.txt | sed 's/project(\(.*\))/\1/' | awk '{print $1}')
# Create test CMakeLists.txt
cat > CMakeLists.txt << EOF
cmake_minimum_required(VERSION 3.20)
project(test-find-package CXX)
set(CMAKE_PREFIX_PATH "${{ runner.temp }}/install")
find_package(${THIS_PROJECT_NAME} REQUIRED)
message(STATUS "Successfully found ${THIS_PROJECT_NAME}")
EOF
# Test find_package
cmake -B build -S .
clang-tidy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Configure CMake with clang-tidy
run: cmake --preset=clang-tidy
- name: Build with clang-tidy
run: cmake --build --preset=clang-tidy
- name: Run tests with clang-tidy
run: ctest --preset=clang-tidy
docs:
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
permissions:
id-token: write
pages: write
contents: read
steps:
- uses: actions/checkout@v5
- name: Install Doxygen
uses: ssciwr/doxygen-install@v1
- name: Configure CMake
run: cmake --preset=docs
- name: Build Documentation
run: cmake --build --preset=docs
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: build/docs/html
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4