-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (64 loc) · 1.99 KB
/
Copy pathci.yml
File metadata and controls
84 lines (64 loc) · 1.99 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
name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake g++ libssl-dev
- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build build -j$(nproc)
- name: Run tests
run: cd build && ctest --output-on-failure
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: brew install cmake openssl
- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
env:
OPENSSL_ROOT_DIR: /usr/local/opt/openssl
- name: Build
run: cmake --build build -j$(sysctl -n hw.ncpu)
- name: Run tests
run: cd build && ctest --output-on-failure
format-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install clang-format
run: sudo apt-get install -y clang-format
- name: Check code format
run: |
find src tests -name "*.cpp" -o -name "*.hpp" -o -name "*.h" | while read file; do
if [ -f "$file" ]; then
diff -u "$file" <(clang-format "$file") || exit 1
fi
done
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Install dependencies
run: |
choco install openssl -y
echo "OPENSSL_ROOT_DIR=C:\Program Files\OpenSSL-Win64" >> $env:GITHUB_ENV
- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build build --config Release -j
- name: Run tests
run: cd build && ctest -C Release --output-on-failure