Merge pull request #503 from larsgrefer/dependabot/github_actions/cod… #1352
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
# This workflow will build a Java project with Gradle | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | |
name: Java CI with Gradle | |
on: | |
push: | |
branches: | |
- master | |
- '[0-9].*' | |
pull_request: | |
branches: | |
- master | |
- '[0-9].*' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
env: | |
ORG_GRADLE_PROJECT_larsgreferBuildCachePassword: ${{ secrets.BUILD_CACHE_PASSWORD }} | |
strategy: | |
fail-fast: false | |
matrix: | |
java: [ 17, 21 ] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK ${{ matrix.java }} | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v3 | |
- run: java -XshowSettings:properties -version | |
- run: env | grep "GIT" | |
- name: Build with Gradle | |
run: ./gradlew build | |
- run: ./gradlew -V uploadGithubDependenciesSnapshot -s | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: ./gradlew jacocoTestReport | |
- name: Upload coverage report | |
uses: codecov/[email protected] | |
with: | |
files: jacoco*.xml,*Jacoco*.xml | |
android-tests: | |
runs-on: ubuntu-latest | |
env: | |
ORG_GRADLE_PROJECT_larsgreferBuildCachePassword: ${{ secrets.BUILD_CACHE_PASSWORD }} | |
strategy: | |
fail-fast: false | |
matrix: | |
api-level: [ 21, 26, 30, 34 ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v3 | |
- name: Enable KVM | |
run: | | |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
sudo udevadm control --reload-rules | |
sudo udevadm trigger --name-match=kvm | |
- name: Run connected tests | |
uses: ReactiveCircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
target: google_apis | |
arch: x86_64 | |
script: ./gradlew connectedCheck |