forked from google/flatbuffers
-
Notifications
You must be signed in to change notification settings - Fork 0
302 lines (283 loc) · 8.83 KB
/
build.yml
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build-linux:
name: Build Linux
runs-on: ubuntu-latest
strategy:
matrix:
cxx: [g++-10, clang++-12]
steps:
- uses: actions/checkout@v1
- name: cmake
run: CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release .
- name: build
run: make -j4
- name: test
run: ./flattests
- name: make flatc executable
run: |
chmod +x flatc
./flatc --version
- name: upload build artifacts
uses: actions/upload-artifact@v1
with:
name: Linux flatc binary ${{ matrix.cxx }}
path: flatc
build-windows:
name: Build Windows 2019
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
- name: cmake
run: cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_CPP17=ON .
- name: build
run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64
- name: test
run: Release\flattests.exe
- name: upload build artifacts
uses: actions/upload-artifact@v1
with:
name: Windows flatc binary
path: Release\flatc.exe
build-windows-2017:
name: Build Windows 2017
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
- name: cmake
run: cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release .
- name: build tool version 15 (VS 2017)
run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64 /p:VisualStudioVersion=15.0
- name: test
run: Release\flattests.exe
build-windows-2015:
name: Build Windows 2015
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
- name: cmake
run: cmake -G "Visual Studio 14 2015" -A x64 -DCMAKE_BUILD_TYPE=Release .
- name: build tool version 14 (VS 2015)
run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64 /p:VisualStudioVersion=14.0
- name: test
run: Release\flattests.exe
build-dotnet-windows:
name: Build .NET Windows
runs-on: windows-latest
strategy:
matrix:
configuration: [
'',
'-p:UnsafeByteBuffer=true',
# Fails two tests currently.
#'-p:EnableSpanT=true,UnsafeByteBuffer=true'
]
steps:
- uses: actions/checkout@v1
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v1.9.0
with:
dotnet-version: '3.1.x'
- name: Build
run: |
cd tests\FlatBuffers.Test
dotnet new sln --force --name FlatBuffers.Core.Test
dotnet sln FlatBuffers.Core.Test.sln add FlatBuffers.Core.Test.csproj
dotnet build -c Release ${{matrix.configuration}} -o out FlatBuffers.Core.Test.sln
- name: Run
run: |
cd tests\FlatBuffers.Test
out\FlatBuffers.Core.Test.exe
build-mac:
name: Build Mac
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: cmake
run: cmake -G "Xcode" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_FLATC_EXECUTABLE=_build/Release/flatc .
- name: build
# NOTE: we need this _build dir to not have xcodebuild's default ./build dir clash with the BUILD file.
run: xcodebuild -toolchain clang -configuration Release -target flattests SYMROOT=$(PWD)/_build
- name: check that the binary is "universal"
run: |
info=$(file _build/Release/flatc)
echo $info
echo $info | grep "universal binary with 2 architectures"
- name: test
run: _build/Release/flattests
- name: make flatc executable
run: |
chmod +x _build/Release/flatc
./_build/Release/flatc --version
- name: upload build artifacts
uses: actions/upload-artifact@v1
with:
name: Mac flatc binary
path: _build/Release/flatc
build-android:
name: Build Android (on Linux)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: set up flatc
run: |
cmake -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF .
make
echo "${PWD}" >> $GITHUB_PATH
- name: build
working-directory: android
run: bash ./gradlew clean build
build-generator:
name: Check Generated Code
runs-on: ubuntu-latest
strategy:
matrix:
cxx: [g++-10, clang++-12]
steps:
- uses: actions/checkout@v1
- name: cmake
run: CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" -DFLATBUFFERS_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release . && make -j4
- name: Generate
run: scripts/check_generate_code.py
- name: Generate gRPC
run: bash scripts/check-grpc-generated-code.sh
build-benchmarks:
name: Build Benchmarks (on Linux)
runs-on: ubuntu-latest
strategy:
matrix:
cxx: [g++-10]
steps:
- uses: actions/checkout@v1
- name: cmake
run: CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" -DFLATBUFFERS_CXX_FLAGS="-Wno-unused-parameter -fno-aligned-new" -DFLATBUFFERS_BUILD_BENCHMARKS=ON -DCMAKE_BUILD_TYPE=Release . && make -j4
- name: Run benchmarks
run: ./flatbenchmark --benchmark_repetitions=5 --benchmark_display_aggregates_only=true --benchmark_out_format=console --benchmark_out=benchmarks/results_${{matrix.cxx}}
- name: Upload benchmarks results
uses: actions/upload-artifact@v1
with:
name: Linux flatbenchmark results ${{matrix.cxx}}
path: benchmarks/results_${{matrix.cxx}}
build-java:
name: Build Java
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: test
working-directory: tests
run: bash JavaTest.sh
build-kotlin-macos:
name: Build Kotlin MacOS
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'adopt-hotspot'
java-version: '11'
- name: Build
working-directory: kotlin
run: ./gradlew clean iosX64Test macosX64Test jsTest jsBrowserTest
build-kotlin-linux:
name: Build Kotlin Linux
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'adopt-hotspot'
java-version: '8'
- name: Build
working-directory: kotlin
run: ./gradlew jvmMainClasses jvmTest
- name: Run Benchmark
working-directory: kotlin
run: ./gradlew jvmBenchmark
- name: Generate Benchmark Report
working-directory: kotlin
run: |
./gradlew jmhReport;
mv benchmark/build/reports/benchmarks/main/* benchmark_latest
- name: Archive benchmark report
uses: actions/upload-artifact@v1
with:
name: Kotlin Benchmark Report
path: kotlin/benchmark_latest
build-rust:
name: Build Rust
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: test
working-directory: tests
run: bash RustTest.sh
build-python:
name: Build Python
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: test
working-directory: tests
run: bash PythonTest.sh
build-go:
name: Build Go
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: flatc
# FIXME: make test script not rely on flatc
run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF . && make -j4
- name: test
working-directory: tests
run: bash GoTest.sh
build-swift:
name: Build Swift
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: test
working-directory: tests/FlatBuffers.Test.Swift
run: sh SwiftTest.sh
build-ts:
name: Build TS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: compile
run: npm run compile
- name: test
working-directory: tests
run: sh TypeScriptTest.sh
build-dart:
name: Build Dart
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: dart-lang/setup-dart@v1
with:
sdk: stable
- name: flatc
# FIXME: make test script not rely on flatc
run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF . && make -j4
- name: test
working-directory: tests
run: bash DartTest.sh