-
Notifications
You must be signed in to change notification settings - Fork 1
147 lines (122 loc) · 3.56 KB
/
Copy pathci.yml
File metadata and controls
147 lines (122 loc) · 3.56 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
138
139
140
141
142
143
144
145
146
147
name: Build and Test
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master ]
env:
BUILD_TYPE: Release
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: ${{ matrix.os }} - ${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Ubuntu with GCC
- os: ubuntu-latest
compiler: gcc-12
cc: gcc-12
cxx: g++-12
- os: ubuntu-latest
compiler: gcc-13
cc: gcc-13
cxx: g++-13
# Ubuntu with Clang
- os: ubuntu-latest
compiler: clang-17
cc: clang-17
cxx: clang++-17
- os: ubuntu-latest
compiler: clang-18
cc: clang-18
cxx: clang++-18
# macOS
- os: macos-latest
compiler: apple-clang
cc: clang
cxx: clang++
steps:
- uses: actions/checkout@v4
- name: Install dependencies (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y ninja-build libomp-dev
# Install specific compiler versions if needed
if [[ "${{ matrix.compiler }}" == "gcc-13" ]]; then
sudo apt-get install -y gcc-13 g++-13
fi
if [[ "${{ matrix.compiler }}" == clang-* ]]; then
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${CLANG_VERSION#clang-}
fi
env:
CLANG_VERSION: ${{ matrix.compiler }}
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install ninja libomp
- name: Configure CMake
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
run: |
cmake -B build \
-G Ninja \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DCMAKE_CXX_FLAGS="-march=native"
- name: Build
run: cmake --build build --config ${{ env.BUILD_TYPE }}
- name: Run Tests
working-directory: build
run: ctest -C ${{ env.BUILD_TYPE }} --output-on-failure --timeout 300
build-debug:
name: Debug Build with Sanitizers
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y ninja-build gcc-12 g++-12 libomp-dev
- name: Configure CMake (Debug)
env:
CC: gcc-12
CXX: g++-12
run: |
cmake -B build \
-G Ninja \
-DCMAKE_BUILD_TYPE=Debug
- name: Build
run: cmake --build build --config Debug
- name: Run Tests
working-directory: build
run: ctest -C Debug --output-on-failure --timeout 300
code-quality:
name: Code Quality Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y ninja-build clang-format-15 cppcheck
- name: Check formatting
run: |
find examples tests benchmarks -name "*.cpp" -o -name "*.hpp" | \
xargs clang-format-15 --dry-run --Werror || \
echo "::warning::Some files need formatting"
- name: Run cppcheck
run: |
cppcheck --enable=warning,style,performance \
--suppress=missingIncludeSystem \
--error-exitcode=0 \
examples/ tests/ benchmarks/ || true