Split CI tests with dockcross flavour and make dockross new test use only latest #239
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-*] | |
schedule: | |
# Every Sunday, rerun | |
- cron: "0 12 * * 0" | |
jobs: | |
tests: | |
name: Java ${{ matrix.java-version }} ${{ matrix.os }} ${{ matrix.dockcross-only }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
java-distribution: [adopt] | |
java-version: [8, 11, 17, 21, 22] | |
dockcross-only: ["android-arm", "android-arm64", "linux-arm64", "linux-armv5", "linux-armv7", "linux-s390x", "linux-ppc64le", "linux-x64", "linux-x86", "windows-static-x64", "windows-static-x86"] | |
steps: | |
- uses: actions/[email protected] | |
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" "-Dh3.dockcross.only=${{ matrix.dockcross-only }}" -B -V clean test site | |
- name: Format check for C | |
run: git diff --exit-code | |
- uses: actions/upload-artifact@v4 | |
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 }} ${{ matrix.dockcross-only }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
java-distribution: [adopt] | |
java-version: [21] | |
dockcross-tag: ["latest"] | |
dockcross-only: ["android-arm", "android-arm64", "linux-arm64", "linux-armv5", "linux-armv7", "linux-s390x", "linux-ppc64le", "linux-x64", "linux-x86", "windows-static-x64", "windows-static-x86"] | |
steps: | |
- uses: actions/[email protected] | |
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 }}" "-Dh3.dockcross.only=${{ matrix.dockcross-only }}" -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 | |
# TODO: Windows pinned back | |
os: [macos-latest, windows-2019] | |
java-distribution: [adopt] | |
java-version: [8, 11, 17, 21, 22] | |
steps: | |
- uses: actions/[email protected] | |
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@v4 | |
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/[email protected] | |
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/[email protected] | |
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/[email protected] | |
with: | |
name: docker-built-shared-objects | |
path: src/main/resources/ | |
- name: Download Mac binaries | |
uses: actions/[email protected] | |
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 }} |