• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: CI
2
3on:
4  push:
5    branches:
6      - master
7  pull_request:
8    branches:
9      - master
10
11jobs:
12  build-linux:
13    name: Build Linux
14    runs-on: ubuntu-latest
15    strategy:
16      matrix:
17        cxx: [g++-9, clang++-9]
18    steps:
19    - uses: actions/checkout@v1
20    - name: cmake
21      run: CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release .
22    - name: build
23      run: make -j4
24    - name: test
25      run: ./flattests
26    - name: upload build artifacts
27      uses: actions/upload-artifact@v1
28      with:
29        name: Linux flatc binary ${{ matrix.cxx }}
30        path: flatc
31
32  build-windows:
33    name: Build Windows
34    runs-on: windows-latest
35    steps:
36    - uses: actions/checkout@v1
37    - name: Add msbuild to PATH
38      uses: microsoft/setup-msbuild@v1.0.2
39    - name: cmake
40      run: cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_CPP17=ON .
41    - name: build
42      run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64
43    - name: test
44      run: Release\flattests.exe
45    - name: upload build artifacts
46      uses: actions/upload-artifact@v1
47      with:
48        name: Windows flatc binary
49        path: Release\flatc.exe
50
51  build-windows-2017:
52    name: Build Windows 2017
53    runs-on: windows-2016
54    steps:
55    - uses: actions/checkout@v1
56    - name: Add msbuild to PATH
57      uses: microsoft/setup-msbuild@v1.0.2
58    - name: cmake
59      run: cmake -G "Visual Studio 15 2017" -A x64 -DCMAKE_BUILD_TYPE=Release .
60    - name: build
61      run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64
62    - name: test
63      run: Release\flattests.exe
64
65  build-mac:
66    name: Build Mac
67    runs-on: macos-latest
68    steps:
69    - uses: actions/checkout@v1
70    - name: cmake
71      run: cmake -G "Xcode" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_FLATC_EXECUTABLE=_build/Release/flatc .
72    - name: build
73      # NOTE: we need this _build dir to not have xcodebuild's default ./build dir clash with the BUILD file.
74      run: xcodebuild -toolchain clang -configuration Release -target flattests SYMROOT=$(PWD)/_build
75    - name: test
76      run: _build/Release/flattests
77    - name: upload build artifacts
78      uses: actions/upload-artifact@v1
79      with:
80        name: Mac flatc binary
81        path: _build/Release/flatc
82
83  build-android:
84   name: Build Android (on Linux)
85   runs-on: ubuntu-latest
86   steps:
87   - uses: actions/checkout@v1
88   - name: set up JDK 1.8
89     uses: actions/setup-java@v1
90     with:
91       java-version: 1.8
92   - name: set up flatc
93     run: |
94       cmake -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF .
95       make
96       echo "${PWD}" >> $GITHUB_PATH
97   - name: build
98     working-directory: android
99     run: bash ./gradlew clean build
100
101  build-generator:
102    name: Check Generated Code
103    runs-on: ubuntu-latest
104    strategy:
105      matrix:
106        cxx: [g++-9, clang++-9]
107    steps:
108    - uses: actions/checkout@v1
109    - name: cmake
110      run: CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" -DFLATBUFFERS_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release . && make -j4
111    - name: Generate
112      run: bash scripts/check-generate-code.sh && bash scripts/check-grpc-generated-code.sh
113
114  build-java:
115    name: Build Java
116    runs-on: ubuntu-latest
117    steps:
118    - uses: actions/checkout@v1
119    - name: test
120      working-directory: tests
121      run: bash JavaTest.sh
122
123  build-kotlin:
124    name: Build Kotlin
125    runs-on: macos-latest
126    steps:
127    - name: Checkout
128      uses: actions/checkout@v1
129    - name: Build
130      working-directory: kotlin
131      run: ./gradlew clean build allTests
132    - name: Run Benchmark
133      working-directory: kotlin
134      run: ./gradlew benchmark
135    - name: Generate Benchmark Report
136      working-directory: kotlin
137      run: |
138        ./gradlew jmhReport;
139        mv benchmark/build/reports/benchmarks/main/* benchmark_latest
140    - name: Archive benchmark report
141      uses: actions/upload-artifact@v1
142      with:
143        name: Kotlin Benchmark Report
144        path: kotlin/benchmark_latest
145
146  build-rust:
147    name: Build Rust
148    runs-on: ubuntu-latest
149    steps:
150    - uses: actions/checkout@v1
151    - name: test
152      working-directory: tests
153      run: bash RustTest.sh
154
155  #build-js:
156  #  name: Build JS
157  #  runs-on: ubuntu-latest
158  #  steps:
159  #  - uses: actions/checkout@v1
160  #  - name: flatc
161  #    # FIXME: make test script not rely on flatc
162  #    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
163  #  - name: test
164  #    working-directory: tests
165  #    run: bash JavaScriptTest.sh
166
167  build-python:
168    name: Build Python
169    runs-on: ubuntu-latest
170    steps:
171    - uses: actions/checkout@v1
172    - name: test
173      working-directory: tests
174      run: bash PythonTest.sh
175
176  build-go:
177    name: Build Go
178    runs-on: ubuntu-latest
179    steps:
180    - uses: actions/checkout@v1
181    - name: flatc
182      # FIXME: make test script not rely on flatc
183      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
184    - name: test
185      working-directory: tests
186      run: bash GoTest.sh
187
188  #build-csharp:
189  #  name: Build CSharp
190  #  runs-on: ubuntu-latest
191  #  steps:
192  #  - uses: actions/checkout@v1
193  #  - name: test
194  #    working-directory: tests/FlatBuffers.Test
195  #    run: bash NetTest.sh
196
197  #build-php:
198  #  name: Build PHP
199  #  runs-on: ubuntu-latest
200  #  steps:
201  #  - uses: actions/checkout@v1
202  #  - name: flatc
203  #    # FIXME: make test script not rely on flatc
204  #    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
205  #  - name: test
206  #    working-directory: tests
207  #    run: |
208  #      php phpTest.php
209  #      sh phpUnionVectorTest.sh
210
211  build-swift:
212    name: Build Swift
213    runs-on: ubuntu-latest
214    steps:
215    - uses: actions/checkout@v1
216    - name: test
217      working-directory: tests/FlatBuffers.Test.Swift
218      run: sh SwiftTest.sh
219
220  build-ts:
221    name: Build TS
222    runs-on: ubuntu-latest
223    steps:
224    - uses: actions/checkout@v1
225    - name: compile
226      run: npm run compile
227    - name: test
228      working-directory: tests
229      run: sh TypeScriptTest.sh
230