Skip to content

Commit

Permalink
Merge c5d4b07 into 76dea88
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacbrodsky committed May 6, 2021
2 parents 76dea88 + c5d4b07 commit e108985
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 17 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: tests

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
tests:
name: Java ${{ matrix.java-version }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
java-distribution: [adopt]
java-version: [8, 11, 15]

steps:
- uses: actions/checkout@v2.1.1
with:
submodules: recursive

- uses: actions/setup-java@v2
with:
distribution: "${{ matrix.java-distribution }}"
java-version: "${{ matrix.java-version }}"

- uses: docker-practice/actions-setup-docker@master
if: "!startsWith(matrix.os, 'windows')"

- uses: actions/cache@v2
id: maven-cache
with:
path: ~/.m2/
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Tests
run: mvn "-Dh3.remove.images=true" -B -V clean test

tests-no-docker:
name: Java (no Docker) ${{ matrix.java-version }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
java-distribution: [adopt]
java-version: [11]

steps:
- uses: actions/checkout@v2.1.1
with:
submodules: recursive

- uses: actions/setup-java@v2
with:
distribution: "${{ matrix.java-distribution }}"
java-version: "${{ matrix.java-version }}"

- uses: actions/cache@v2
id: maven-cache
with:
path: ~/.m2/
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Tests
run: |
mvn install -DskipTests=true -B -V -Dh3.use.docker=false
mvn test -B -Dh3.use.docker=false
10 changes: 0 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,3 @@ matrix:
script:
- mvn clean test jacoco:report coveralls:report -Dh3.test.system=true -Dh3.additional.argLine="-Djava.library.path=./src/main/resources/linux-x64/"
- 'if [ -n "$FOSSA_API_KEY" ]; then fossa; fi'
- os: linux
jdk: openjdk11
- name: "Linux without Docker"
os: linux
jdk: oraclejdk11
install:
- mvn install -DskipTests=true -B -V -Dh3.use.docker=false
script:
- mvn test -B -Dh3.use.docker=false
- os: osx
4 changes: 3 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@

<h3.git.remote>https://github.com/uber/h3.git</h3.git.remote>
<h3.use.docker>true</h3.use.docker>
<h3.remove.images>false</h3.remove.images>
<!-- Used for passing additional arguments to surefire when using JaCoCo -->
<h3.additional.argLine />

Expand Down Expand Up @@ -206,7 +207,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<version>0.8.7</version>
<executions>
<execution>
<id>jacoco-instrument</id>
Expand Down Expand Up @@ -242,6 +243,7 @@
<argument>${h3.git.remote}</argument>
<argument>${h3.git.reference}</argument>
<argument>${h3.use.docker}</argument>
<argument>${h3.remove.images}</argument>
</arguments>
</configuration>
</execution>
Expand Down
23 changes: 17 additions & 6 deletions src/main/c/h3-java/build-h3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@
# limitations under the License.
#

# Arguments: [git-remote] [git-ref] [use-docker]
# git-remote - The git remote to pull from. An existing cloned repository
# will not be deleted if a new remote is specified.
# git-ref - Specific git ref of H3 to build.
# use-docker - "true" to perform cross compilation via Docker, "false" to
# skip that step.
# Arguments: [git-remote] [git-ref] [use-docker] [remove-images]
# git-remote - The git remote to pull from. An existing cloned repository
# will not be deleted if a new remote is specified.
# git-ref - Specific git ref of H3 to build.
# use-docker - "true" to perform cross compilation via Docker, "false" to
# skip that step.
# remove-images - If use-docker is true and this argument is true, Docker
# cross compilation images will be removed after each step
# (i.e. for disk space constrained environments like CI)
#
# This script downloads H3, builds H3 and the H3-Java native library, and
# cross compiles via Docker.
Expand All @@ -33,6 +36,7 @@ set -ex
GIT_REMOTE=$1
GIT_REVISION=$2
USE_DOCKER=$3
REMOVE_IMAGES=$4

echo Downloading H3 from "$GIT_REMOTE"

Expand Down Expand Up @@ -136,4 +140,11 @@ for image in android-arm android-arm64 linux-arm64 linux-armv5 linux-armv7 linux
if [ -e $BUILD_ROOT/lib/libh3-java.so ]; then cp $BUILD_ROOT/lib/libh3-java.so $OUTPUT_ROOT ; fi
if [ -e $BUILD_ROOT/lib/libh3-java.dylib ]; then cp $BUILD_ROOT/lib/libh3-java.dylib $OUTPUT_ROOT ; fi
if [ -e $BUILD_ROOT/lib/libh3-java.dll ]; then cp $BUILD_ROOT/lib/libh3-java.dll $OUTPUT_ROOT ; fi

if $REMOVE_IMAGES; then
docker rmi dockcross/$image
rm $BUILD_ROOT/dockcross
fi
echo Current disk usage:
df -h
done

0 comments on commit e108985

Please sign in to comment.