use Files.createTempFile #197
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: tests | |
on: | |
push: | |
branches: [master, stable-*] | |
pull_request: | |
branches: [master, stable-*] | |
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, 17] | |
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: Format check | |
if: ${{ matrix.java-version != 8 }} | |
run: mvn com.spotify.fmt:fmt-maven-plugin:check | |
- name: Tests | |
run: mvn "-Dh3.system.prune=true" -B -V clean test site | |
- name: Format check for C | |
run: git diff --exit-code | |
- uses: actions/upload-artifact@v3 | |
name: Upload artifacts | |
if: ${{ matrix.java-version == 8 }} | |
with: | |
name: docker-built-shared-objects | |
path: | | |
src/main/resources/*/*.so | |
src/main/resources/*/*.dll | |
if-no-files-found: error | |
tests-new-dockcross: | |
name: Dockcross ${{ matrix.dockcross-tag }} Java ${{ matrix.java-version }} ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
java-distribution: [adopt] | |
java-version: [17] | |
dockcross-tag: ["20220906-e88a3ce", "20230116-670f7f7"] | |
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.system.prune=true" "-Dh3.dockcross.tag=${{ matrix.dockcross-tag }}" -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, 17] | |
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 site | |
- uses: actions/upload-artifact@v3 | |
name: Upload Mac OS Artifacts | |
if: ${{ matrix.os == 'macos-latest' && matrix.java-version == 8 }} | |
with: | |
name: macos-built-shared-objects | |
path: src/main/resources/*/*.dylib | |
if-no-files-found: error | |
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 }} | |
tests-use-built-artifacts: | |
name: Java (Built Artifacts) ${{ matrix.java-version }} ${{ matrix.os }} | |
needs: | |
- tests | |
- tests-no-docker | |
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: Download Docker binaries | |
uses: actions/download-artifact@v3 | |
with: | |
name: docker-built-shared-objects | |
path: src/main/resources/ | |
- name: Download Mac binaries | |
uses: actions/download-artifact@v3 | |
with: | |
name: macos-built-shared-objects | |
path: src/main/resources/ | |
- name: Download and test | |
run: | | |
mvn clean test -Dh3.github.artifacts.use=true -Dh3.github.artifacts.by_run=true | |
env: | |
GH_TOKEN: ${{ github.token }} |