Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update ci #39

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 72 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ jobs:
steps:
- name: Checkout project sources
uses: actions/checkout@v4
- uses: actions/setup-java@v3

- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Build with Gradle Wrapper
uses: gradle/[email protected]
uses: gradle/actions/wrapper-validation@v3

- name: Gradle Setup
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper
arguments: build
Expand All @@ -36,52 +39,87 @@ jobs:
permissions:
contents: read
steps:
- name: Checkout project source code
- name: Checkout the code
uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v3

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: "temurin"

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Build with Gradle Wrapper
uses: gradle/[email protected]
uses: gradle/actions/wrapper-validation@v3

- name: Gradle Setup
uses: gradle/actions/setup-gradle@v3
with:
arguments: test --full-stacktrace

android-tests:
runs-on: macos-latest
runs-on: ubuntu-latest
timeout-minutes: 35
needs: [ build-gradle, unit-tests ]
strategy:
matrix:
include:
- api-level: 28
target: default
arch: x86
- api-level: 33
target: google_apis # emulator API 33 only exists with Google APIs
arch: x86_64
api-level: [26,33]
target: [google_apis]
arch: [x86_64]
permissions:
contents: read
steps:
- 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: Checkout the code
uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v3

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: "temurin"

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/actions/wrapper-validation@v3

- name: Gradle Setup
uses: gradle/actions/setup-gradle@v3

- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}-${{ matrix.target }}-${{ matrix.arch }}

- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."

- name: Run android tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
script: ./gradlew $GRADLE_OPTS connectedCheck --stacktrace
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: ./gradlew connectedCheck --stacktrace

publish-to-snapshot:
name: Publish SNAPSHOT to sonatype.org
Expand All @@ -93,16 +131,21 @@ jobs:
contents: read
packages: write
steps:
- name: Checkout project sources
uses: actions/checkout@v3
- uses: actions/setup-java@v3

- name: Checkout the code
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
java-version: 17
distribution: "temurin"

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/actions/wrapper-validation@v3

- name: Publish with Gradle Wrapper
uses: gradle/gradle-build-action@v3.1.0
uses: gradle/actions/setup-gradle@v3
with:
arguments: publishAllPublicationsToMavenCentral --full-stacktrace
env:
Expand Down
Loading