Skip to content

Commit

Permalink
Merge e015c68 into 76dea88
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacbrodsky committed May 6, 2021
2 parents 76dea88 + e015c68 commit b601fd9
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 54 deletions.
1 change: 1 addition & 0 deletions .appveyor.yml
Expand Up @@ -12,5 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# TODO: Remove this and replace with Github Actions only
build_script:
- mvn clean package --batch-mode -V
106 changes: 106 additions & 0 deletions .github/workflows/tests.yml
@@ -0,0 +1,106 @@
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: [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: 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:
# TODO: Docker on macos-latest running is not working
os: [macos-latest, windows-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: 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 -B -V clean test

tests-coverage:
name: Java (Coverage) ${{ matrix.java-version }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}

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

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: Coverage report
run: |
mvn clean test jacoco:report coveralls:report -Dh3.use.docker=false -Dh3.test.system=true -Dh3.additional.argLine="-Djava.library.path=./src/main/resources/linux-x64/" --no-transfer-progress -DrepoToken=$COVERALLS_SECRET -DpullRequest=${{ github.event.number }}
env:
CI_NAME: github
COVERALLS_SECRET: ${{ secrets.GITHUB_TOKEN }}
46 changes: 0 additions & 46 deletions .travis.yml

This file was deleted.

6 changes: 4 additions & 2 deletions pom.xml
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 @@ -160,7 +161,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>29.0-jre</version>
<version>30.0-jre</version>
<scope>test</scope>
</dependency>
</dependencies>
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
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 b601fd9

Please sign in to comment.