-
Notifications
You must be signed in to change notification settings - Fork 0
145 lines (121 loc) · 3.46 KB
/
Copy pathci.yml
File metadata and controls
145 lines (121 loc) · 3.46 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
name: CI
on:
push:
branches: [ "main", "develop" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
env:
BUILD_TYPE: Release
jobs:
build-linux:
name: Build (Linux)
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [gcc, clang]
include:
- compiler: gcc
cc: gcc-12
cxx: g++-12
- compiler: clang
cc: clang-15
cxx: clang++-15
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
cmake \
ninja-build \
libssl-dev \
zlib1g-dev \
${{ matrix.compiler == 'clang' && 'clang-15' || '' }}
- name: Configure CMake
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
run: |
cmake -B build \
-G Ninja \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DENABLE_TELEMETRY=ON \
-DENABLE_SCRIPTING=OFF \
-DENABLE_COMPRESSION=ON \
-DBUILD_TESTS=ON
- name: Build
run: cmake --build build --parallel $(nproc)
- name: Run tests
working-directory: build
run: ctest --output-on-failure --timeout 120
- name: Upload build artifact
if: matrix.compiler == 'gcc'
uses: actions/upload-artifact@v4
with:
name: rs2v-server-linux
path: build/rs2v_server
retention-days: 7
build-windows:
name: Build (Windows)
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Configure CMake
run: |
cmake -B build `
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} `
-DENABLE_TELEMETRY=ON `
-DENABLE_SCRIPTING=OFF `
-DENABLE_COMPRESSION=ON `
-DBUILD_TESTS=ON
- name: Build
run: cmake --build build --config ${{ env.BUILD_TYPE }} --parallel
- name: Run tests
working-directory: build
run: ctest -C ${{ env.BUILD_TYPE }} --output-on-failure --timeout 120
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: rs2v-server-windows
path: build/${{ env.BUILD_TYPE }}/rs2v_server.exe
retention-days: 7
static-analysis:
name: Static Analysis
runs-on: ubuntu-latest
needs: build-linux
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install cppcheck
run: sudo apt-get update && sudo apt-get install -y cppcheck
- name: Run cppcheck
run: |
cppcheck \
--enable=warning,performance,portability \
--suppress=missingIncludeSystem \
--inline-suppr \
--error-exitcode=1 \
-I src/ -I include/ -I telemetry/ \
--std=c++17 \
src/ telemetry/
docker:
name: Docker Build
runs-on: ubuntu-latest
needs: build-linux
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
uses: docker/build-push-action@v6
with:
context: .
push: false
tags: rs2v-server:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max