From f116b802c1fd48d18d833b697bb570a1bba30c51 Mon Sep 17 00:00:00 2001 From: Wouter van Oortmerssen Date: Tue, 5 May 2020 10:47:29 -0700 Subject: [PATCH] Attempt at adding Github Actions CI --- .github/workflows/build.yml | 79 +++++++++++++++++++ android/build.gradle | 4 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000000..d9b1900212fc --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,79 @@ +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.0 + - 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-mac: + name: Build Mac + runs-on: macos-latest + steps: + - uses: actions/checkout@v1 + - name: cmake + run: cmake -G "Xcode" -DCMAKE_BUILD_TYPE=Release . + - name: build + run: xcodebuild -toolchain clang -configuration Release -target flattests + - name: test + run: Release/flattests + - name: upload build artifacts + uses: actions/upload-artifact@v1 + with: + name: Mac flatc binary + path: 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: build + working-directory: android + run: bash ./gradlew buildDebug diff --git a/android/build.gradle b/android/build.gradle index 5e9809be7698..5d1f867de60f 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -16,15 +16,17 @@ buildscript { repositories { + google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.0' + classpath 'com.android.tools.build:gradle:3.0.1' } } allprojects { repositories { + google() jcenter() } } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 1e1168cf6cf1..f4238fa914fc 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip