forked from BigfootDev/flatbuffers
on the current Java Implementation. The code dependencies related to JVM were removed and the project is able to target all available platforms. The only requirement to implement to fully support a target is to implement functions described in `ByteArray.kt`. Right now the code support JVM and native targets. JS port still missing, but just be trivial to introduce. Currently, only the `jvm` and `macosX64` targets are enabled until we figure out how to enable tests on all platforms on CI. A submodule called "benchmark" is also introduced. It contains a series of benchmarks comparing Java and Kotlin implementations of FlexBuffers and the UTF8 API. Finally, this commit does not contain the scripts necessary to publish the artifacts. This will be introduced at a later stage once the team has an agreement on how to rollout Kotlin releases.
218 lines
6.2 KiB
YAML
218 lines
6.2 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build-linux:
|
|
name: Build Linux
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
cxx: [g++-9, clang++-9]
|
|
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: upload build artifacts
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: Linux flatc binary ${{ matrix.cxx }}
|
|
path: flatc
|
|
|
|
build-windows:
|
|
name: Build Windows
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- name: Add msbuild to PATH
|
|
uses: microsoft/setup-msbuild@v1.0.2
|
|
- name: cmake
|
|
run: cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release .
|
|
- 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-2016
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- name: Add msbuild to PATH
|
|
uses: microsoft/setup-msbuild@v1.0.2
|
|
- name: cmake
|
|
run: cmake -G "Visual Studio 15 2017" -A x64 -DCMAKE_BUILD_TYPE=Release .
|
|
- name: build
|
|
run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64
|
|
- name: test
|
|
run: Release\flattests.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: test
|
|
run: _build/Release/flattests
|
|
- 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-java:
|
|
name: Build Java
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- name: test
|
|
working-directory: tests
|
|
run: bash JavaTest.sh
|
|
|
|
build-kotlin:
|
|
name: Build Kotlin
|
|
runs-on: macos-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v1
|
|
- name: Build
|
|
working-directory: kotlin
|
|
run: ./gradlew clean build allTests
|
|
- name: Run Benchmark
|
|
working-directory: kotlin
|
|
run: ./gradlew benchmark
|
|
- 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-js:
|
|
# name: Build JS
|
|
# 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 JavaScriptTest.sh
|
|
|
|
#build-ts:
|
|
# name: Build TS
|
|
# 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 TypeScriptTest.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-csharp:
|
|
# name: Build CSharp
|
|
# runs-on: ubuntu-latest
|
|
# steps:
|
|
# - uses: actions/checkout@v1
|
|
# - name: test
|
|
# working-directory: tests/FlatBuffers.Test
|
|
# run: bash NetTest.sh
|
|
|
|
#build-php:
|
|
# name: Build PHP
|
|
# 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: |
|
|
# php phpTest.php
|
|
# sh phpUnionVectorTest.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
|