-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (107 loc) · 3.35 KB
/
Copy pathci.yml
File metadata and controls
137 lines (107 loc) · 3.35 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
134
135
136
137
# 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:
name: Test (${{ matrix.name }})
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu GCC
os: ubuntu-latest
cc: gcc
cxx: g++
- name: Ubuntu Clang
os: ubuntu-latest
cc: clang
cxx: clang++
- name: macOS
os: macos-latest
- name: Windows
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- name: Configure CMake
run: cmake --preset=test
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
- 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
# Create test CMakeLists.txt
cat > CMakeLists.txt << EOF
cmake_minimum_required(VERSION 3.20)
project(test-find-package CXX)
find_package(stlab-enum-ops REQUIRED)
message(STATUS "Successfully found stlab-enum-ops")
EOF
# Convert paths to forward slashes for CMake (works on all platforms)
INSTALL_PREFIX=$(echo "${{ runner.temp }}/install" | sed 's|\\|/|g')
# Test find_package with CMAKE_PREFIX_PATH
cmake -B build -S . -DCMAKE_PREFIX_PATH="${INSTALL_PREFIX}"
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