mirror of
https://github.com/LSPosed/LSPlant.git
synced 2025-05-04 20:42:02 +08:00
201 lines
6.6 KiB
YAML
201 lines
6.6 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches: ["master"]
|
|
paths-ignore:
|
|
- 'README.md'
|
|
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@v3
|
|
with:
|
|
submodules: 'recursive'
|
|
- name: Set up JDK 11
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: '11'
|
|
cache: 'gradle'
|
|
- name: Gradle cache
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}
|
|
- name: ccache
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
with:
|
|
key: ${{ runner.os }}-${{ github.sha }}
|
|
restore-keys: ${{ runner.os }}
|
|
- name: Build with Gradle
|
|
run: |
|
|
ccache -o cache_dir=${{ github.workspace }}/.ccache
|
|
ccache -o hash_dir=false
|
|
ccache -o compiler_check='%compiler% -dumpmachine; %compiler% -dumpversion'
|
|
ccache -p
|
|
echo 'android.native.buildOutput=verbose' >> gradle.properties
|
|
./gradlew :lsplant:publishToMavenLocal :lsplant:prefabDebugPackage
|
|
env:
|
|
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.maven_pgp_signingKey }}
|
|
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.maven_pgp_signingPassword }}
|
|
- name: Upload library
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: ${{ matrix.os }}-library
|
|
path: ~/.m2
|
|
|
|
agp-test:
|
|
needs: build
|
|
name: Test using AGP
|
|
runs-on: macos-latest
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: 'recursive'
|
|
- name: Set up JDK 11
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: '11'
|
|
cache: 'gradle'
|
|
- name: Gradle cache
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}
|
|
restore-keys: gradle-${{ runner.os }}-
|
|
- name: ccache
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
with:
|
|
key: ${{ runner.os }}-${{ github.sha }}
|
|
restore-keys: ${{ runner.os }}
|
|
save: false
|
|
- name: Test with Gradle
|
|
run: |
|
|
ccache -o cache_dir=${{ github.workspace }}/.ccache
|
|
ccache -o hash_dir=false
|
|
ccache -o compiler_check='%compiler% -dumpmachine; %compiler% -dumpversion'
|
|
echo -e "84831b9409646a918e30573bab4c9c91346d8abd" > $ANDROID_SDK_ROOT/licenses/android-sdk-preview-license
|
|
echo 'android.testoptions.manageddevices.emulator.gpu=swiftshader_indirect' >> gradle.properties
|
|
echo 'android.native.buildOutput=verbose' >> gradle.properties
|
|
echo 'android.sdk.channel=3' >> gradle.properties
|
|
sudo rm -R /Applications/Xcode*
|
|
./gradlew :test:allDevicesDebugAndroidTest
|
|
rm -v test/build/outputs/androidTest-results/managedDevice/*/testlog/adb.additional_test_output*
|
|
- name: Upload outputs
|
|
if: always()
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: test-outputs
|
|
path: test/build/outputs
|
|
|
|
test:
|
|
needs: build
|
|
name: Test on API ${{ matrix.api-level }} ${{ matrix.arch }}
|
|
runs-on: macos-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- api-level: 21
|
|
target: default
|
|
arch: x86_64
|
|
- api-level: 21
|
|
target: default
|
|
arch: x86
|
|
- api-level: 22
|
|
target: default
|
|
arch: x86_64
|
|
- api-level: 22
|
|
target: default
|
|
arch: x86
|
|
- api-level: 23
|
|
target: default
|
|
arch: x86_64
|
|
- api-level: 23
|
|
target: default
|
|
arch: x86
|
|
- api-level: 24
|
|
target: default
|
|
arch: x86_64
|
|
- api-level: 24
|
|
target: default
|
|
arch: x86
|
|
- api-level: 25
|
|
target: default
|
|
arch: x86_64
|
|
- api-level: 25
|
|
target: default
|
|
arch: x86
|
|
- api-level: 26
|
|
target: default
|
|
arch: x86_64
|
|
- api-level: 26
|
|
target: default
|
|
arch: x86
|
|
- api-level: 31
|
|
target: android-tv
|
|
arch: x86
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: 'recursive'
|
|
- name: Set up JDK 11
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: '11'
|
|
cache: 'gradle'
|
|
- name: Gradle cache
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: gradle-${{ runner.os }}-${{ matrix.api-level }}-${{ matrix.arch }}-${{ matrix.target }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}
|
|
restore-keys: gradle-${{ runner.os }}-
|
|
- name: ccache
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
with:
|
|
key: ${{ runner.os }}-${{ github.sha }}
|
|
restore-keys: ${{ runner.os }}
|
|
save: false
|
|
- name: run tests
|
|
uses: reactivecircus/android-emulator-runner@v2
|
|
with:
|
|
api-level: ${{ matrix.api-level }}
|
|
arch: ${{ matrix.arch }}
|
|
target: ${{ matrix.target }}
|
|
script: |
|
|
ccache -o cache_dir=${{ github.workspace }}/.ccache
|
|
ccache -o hash_dir=false
|
|
ccache -o compiler_check='%compiler% -dumpmachine; %compiler% -dumpversion'
|
|
echo 'android.native.buildOutput=verbose' >> gradle.properties
|
|
./gradlew :test:connectedCheck
|
|
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
|
disable-animations: true
|
|
avd-name: ${{ matrix.api-level }}_${{ matrix.arch }}
|
|
- name: Upload outputs
|
|
if: always()
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: test-outputs
|
|
path: test/build/outputs
|