Skip to content

Commit 6290611

Browse files
committed
Attempt at adding Github Actions CI
1 parent 7e4124d commit 6290611

File tree

3 files changed

+83
-2
lines changed

3 files changed

+83
-2
lines changed

.github/workflows/build.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
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/[email protected]
39+
- name: cmake
40+
run: cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release .
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-mac:
52+
name: Build Mac
53+
runs-on: macos-latest
54+
steps:
55+
- uses: actions/checkout@v1
56+
- name: cmake
57+
run: cmake -G "Xcode" -DCMAKE_BUILD_TYPE=Release .
58+
- name: build
59+
run: xcodebuild -toolchain clang -configuration Release -target flattests
60+
- name: test
61+
run: Release/flattests
62+
- name: upload build artifacts
63+
uses: actions/upload-artifact@v1
64+
with:
65+
name: Mac flatc binary
66+
path: Release/flatc
67+
68+
build-android:
69+
name: Build Android (on Linux)
70+
runs-on: ubuntu-latest
71+
steps:
72+
- uses: actions/checkout@v1
73+
- name: set up JDK 1.8
74+
uses: actions/setup-java@v1
75+
with:
76+
java-version: 1.8
77+
- name: build
78+
working-directory: android
79+
run: bash ./gradlew buildDebug

android/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@
1616

1717
buildscript {
1818
repositories {
19+
google()
1920
jcenter()
2021
}
2122
dependencies {
22-
classpath 'com.android.tools.build:gradle:2.3.0'
23+
classpath 'com.android.tools.build:gradle:3.0.1'
2324
}
2425
}
2526

2627
allprojects {
2728
repositories {
29+
google()
2830
jcenter()
2931
}
3032
}

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

0 commit comments

Comments
 (0)