diff --git a/.appveyor.yml b/.appveyor.yml index 0ebe4be..ea56833 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..38618b2 --- /dev/null +++ b/.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 }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 383dc2b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright 2018-2019 Uber Technologies, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -language: java -dist: xenial - -sudo: required - -cache: - directories: - - $HOME/.m2 - -services: - - docker - -matrix: - include: - - name: "Coverage and FOSSA report" - os: linux - jdk: openjdk8 - before_script: - - "curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | sudo bash" - 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 diff --git a/pom.xml b/pom.xml index 6a31c22..353b280 100644 --- a/pom.xml +++ b/pom.xml @@ -70,6 +70,7 @@