mirror of
https://github.com/LSPosed/LSPlant.git
synced 2025-05-04 20:42:02 +08:00
85 lines
2.6 KiB
YAML
85 lines
2.6 KiB
YAML
name: Build
|
|
|
|
on: [ push, pull_request ]
|
|
|
|
jobs:
|
|
build:
|
|
name: Build on ${{ matrix.os }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ ubuntu-latest, windows-latest, macOS-latest ]
|
|
|
|
steps:
|
|
- name: Check out
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: 'recursive'
|
|
- name: Set up JDK 11
|
|
uses: actions/setup-java@v1
|
|
with:
|
|
java-version: '11'
|
|
- name: Build with Gradle
|
|
run: ./gradlew :lsplant:publishToMavenLocal
|
|
env:
|
|
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.maven_pgp_signingKey }}
|
|
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.maven_pgp_signingPassword }}
|
|
- name: Upload library
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: ${{ matrix.os }}-library
|
|
path: ~/.m2
|
|
|
|
test:
|
|
needs: build
|
|
name: Test on API ${{ matrix.api-level }}
|
|
runs-on: macos-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
api-level: [ 28, 29, 30, 31, 32 ]
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: 'recursive'
|
|
- name: Set up JDK 11
|
|
uses: actions/setup-java@v1
|
|
with:
|
|
java-version: '11'
|
|
- name: AVD cache
|
|
uses: actions/cache@v2
|
|
id: avd-cache
|
|
with:
|
|
path: |
|
|
~/.android/avd/*
|
|
~/.android/adb*
|
|
key: avd-${{ matrix.api-level }}
|
|
- 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 }}
|
|
arch: x86_64
|
|
target: google_apis
|
|
script: echo "Generated AVD snapshot for caching."
|
|
force-avd-creation: false
|
|
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
|
disable-animations: false
|
|
- name: run tests
|
|
uses: reactivecircus/android-emulator-runner@v2
|
|
with:
|
|
api-level: ${{ matrix.api-level }}
|
|
arch: x86_64
|
|
target: google_apis
|
|
script: ./gradlew :test:connectedCheck; ./gradlew :test:connectedCheck
|
|
force-avd-creation: false
|
|
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
|
disable-animations: true
|
|
- name: Upload outputs
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: test-outputs
|
|
path: test/build/outputs
|