@@ -18,35 +18,26 @@ jobs:
18
18
include :
19
19
- os : ubuntu-latest
20
20
cmake-args : -G Ninja
21
+ cmake-init-env : CXXFLAGS=-Werror
21
22
package-file : " *-linux_x86_64.tar.xz"
22
23
fancy : true
23
- env :
24
- CFLAGS : -Wdeclaration-after-statement -Werror
25
- CXXFLAGS : -Werror
26
24
- os : ubuntu-20.04
27
25
cmake-path : /usr/bin/
28
26
cmake-args : -G Ninja -DTEST_MYSQL=ON
27
+ cmake-init-env : CXXFLAGS=-Werror
28
+ gtest-env : GTEST_FILTER=-*SQLite*
29
29
package-file : " *-linux_x86_64.tar.xz"
30
30
fancy : false
31
- env :
32
- CFLAGS : -Wdeclaration-after-statement -Werror
33
- CXXFLAGS : -Werror
34
- GTEST_FILTER : -*SQLite*
35
31
- os : macOS-latest
36
32
cmake-args : -G Ninja
33
+ cmake-init-env : CXXFLAGS=-Werror
37
34
package-file : " *-macos.dmg"
38
35
fancy : false
39
- env :
40
- CFLAGS : -Wdeclaration-after-statement -Werror
41
- CXXFLAGS : -Werror
42
36
- os : windows-latest
43
37
cmake-args : -A x64
38
+ cmake-init-env : CXXFLAGS=/WX LDFLAGS=/WX
44
39
package-file : " *-win64.zip"
45
40
fancy : false
46
- env :
47
- CFLAGS : /WX
48
- CXXFLAGS : /WX
49
- LDFLAGS : /WX
50
41
51
42
steps :
52
43
- uses : actions/checkout@v3
63
54
- name : Prepare Linux (non-fancy)
64
55
if : ${{ contains(matrix.os, 'ubuntu') && !matrix.fancy }}
65
56
run : |
57
+ rustup default 1.48.0
66
58
sudo rm -rf /var/lib/mysql/ /var/run/mysqld
67
59
sudo mkdir /var/lib/mysql/ /var/run/mysqld/
68
60
sudo chown mysql:mysql /var/lib/mysql/ /var/run/mysqld/
@@ -102,57 +94,49 @@ jobs:
102
94
sudo rm -rf /Library/Developer/CommandLineTools
103
95
104
96
- name : Build in debug mode
105
- env : ${{ matrix.env }}
106
97
run : |
107
98
mkdir debug
108
99
cd debug
109
- ${{ matrix.cmake-path }}cmake --version
110
- ${{ matrix.cmake-path }}cmake ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE=Debug -Werror=dev -DDOWNLOAD_GTEST=ON -DDEV=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=. ..
100
+ ${{ matrix.cmake-path }}cmake -E env ${{ matrix.cmake-init-env }} ${{ matrix.cmake-path }}cmake ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE=Debug -Werror=dev -DDOWNLOAD_GTEST=ON -DDEV=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=. ..
111
101
${{ matrix.cmake-path }}cmake --build . --config Debug --target everything ${{ matrix.build-args }}
112
102
113
103
- name : Test debug
114
- env : ${{ matrix.env }}
115
104
run : |
116
105
cd debug
117
- ${{ matrix.cmake-path }}cmake --build . --config Debug --target run_tests ${{ matrix.build-args }}
106
+ ${{ matrix.cmake-path }}cmake -E env ${{ matrix.gtest-env }} ${{ matrix.cmake-path }}cmake - -build . --config Debug --target run_tests ${{ matrix.build-args }}
118
107
119
108
- name : Run debug server
120
- env : ${{ matrix.env }}
121
109
run : |
122
110
cd debug
123
111
./DDNet-Server shutdown
124
112
125
113
- name : Build in release mode
126
- env : ${{ matrix.env }}
127
114
run : |
128
115
mkdir release
129
116
cd release
130
- ${{ matrix.cmake-path }}cmake ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE=Release -Werror=dev -DDOWNLOAD_GTEST=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=. ..
117
+ ${{ matrix.cmake-path }}cmake -E env ${{ matrix.cmake-init-env }} ${{ matrix.cmake-path }}cmake ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE=Release -Werror=dev -DDOWNLOAD_GTEST=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=. ..
131
118
${{ matrix.cmake-path }}cmake --build . --config Release --target everything ${{ matrix.build-args }}
132
119
133
120
- name : Test release
134
- env : ${{ matrix.env }}
135
121
run : |
136
122
cd release
137
- ${{ matrix.cmake-path }}cmake --build . --config Release --target run_tests ${{ matrix.build-args }}
123
+ ${{ matrix.cmake-path }}cmake -E env ${{ matrix.gtest-env }} ${{ matrix.cmake-path }}cmake - -build . --config Release --target run_tests ${{ matrix.build-args }}
138
124
139
125
- name : Run release server
140
- env : ${{ matrix.env }}
141
126
run : |
142
127
cd release
143
128
./DDNet-Server shutdown
144
129
145
130
- name : Build headless client
146
131
if : contains(matrix.os, 'ubuntu-latest')
147
- env : ${{ matrix.env }}
148
132
run : |
149
133
mkdir headless
150
134
cd headless
151
135
CFLAGS="$CFLAGS --coverage"
152
136
CXXFLAGS="$CXXFLAGS --coverage"
153
137
LDFLAGS="$LDFLAGS --coverage"
154
138
${{ matrix.cmake-path }}cmake --version
155
- ${{ matrix.cmake-path }}cmake ${{ matrix.cmake-args }} -DHEADLESS_CLIENT=ON -DCMAKE_BUILD_TYPE=Debug -Werror=dev -DDOWNLOAD_GTEST=ON -DDEV=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=. ..
139
+ ${{ matrix.cmake-path }}cmake -E env ${{ matrix.cmake-init-env }} ${{ matrix.cmake-path }}cmake ${{ matrix.cmake-args }} -DHEADLESS_CLIENT=ON -DCMAKE_BUILD_TYPE=Debug -Werror=dev -DDOWNLOAD_GTEST=ON -DDEV=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=. ..
156
140
${{ matrix.cmake-path }}cmake --build . --config Debug ${{ matrix.build-args }}
157
141
158
142
- name : Test headless client (unit tests)
@@ -188,23 +172,21 @@ jobs:
188
172
189
173
- name : Build in release mode with debug info and all features on
190
174
if : matrix.fancy
191
- env : ${{ matrix.env }}
192
175
run : |
193
176
mkdir fancy
194
177
cd fancy
195
- ${{ matrix.cmake-path }}cmake ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDOWNLOAD_GTEST=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=. -DANTIBOT=ON -DWEBSOCKETS=ON ..
178
+ ${{ matrix.cmake-path }}cmake -E env ${{ matrix.cmake-init-env }} ${{ matrix.cmake-path }}cmake ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDOWNLOAD_GTEST=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=. -DANTIBOT=ON -DWEBSOCKETS=ON ..
196
179
${{ matrix.cmake-path }}cmake --build . --config RelWithDebInfo --target everything ${{ matrix.build-args }}
197
180
198
181
- name : Test fancy
199
182
if : matrix.fancy
200
- env : ${{ matrix.env }}
201
183
run : |
184
+ find /usr/lib/ -name '*libwebsockets*'
202
185
cd fancy
203
- ${{ matrix.cmake-path }}cmake --build . --config RelWithDebInfo --target run_tests ${{ matrix.build-args }}
186
+ ${{ matrix.cmake-path }}cmake -E env ${{ matrix.gtest-env }} ${{ matrix.cmake-path }}cmake - -build . --config RelWithDebInfo --target run_tests ${{ matrix.build-args }}
204
187
205
188
- name : Run fancy server
206
189
if : matrix.fancy
207
- env : ${{ matrix.env }}
208
190
run : |
209
191
cd fancy
210
192
./DDNet-Server shutdown
0 commit comments