diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2507b447b..641143f27 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,15 +13,10 @@ on: jobs: build_and_upload_artifacts: name: Generate APK - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: '2.7' - - uses: gradle/wrapper-validation-action@v1 - name: set up JDK 11 @@ -33,7 +28,7 @@ jobs: - name: Prepare thirdparty run: bash ./gradlew -b thirdparty_build.gradle downloadAndPatchDjvu downloadAndMakeMupdf - name: Build debug APK - run: bash ./gradlew assembleDev --stacktrace -Porion.CIBuild=true + run: bash ./gradlew assembleDebug --stacktrace -Porion.CIBuild=true - name: Read value from Properties-file id: read_version_property uses: christian-draeger/read-properties@1.0.1 @@ -42,22 +37,62 @@ jobs: property: 'orion.version.name' - name: Upload arm7 APK - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: - name: orion-viewer-dev-${{steps.read_version_property.outputs.value}}-${{github.run_number}}-arm7.zip - path: orion-viewer/build/outputs/apk/arm7/dev/*.apk + name: orion-viewer-${{steps.read_version_property.outputs.value}}-${{github.run_number}}-arm7-debug.zip + path: orion-viewer/build/outputs/apk/arm7/debug/orion-viewer-${{steps.read_version_property.outputs.value}}-arm7-debug.apk - name: Upload arm64 APK - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: - name: orion-viewer-dev-${{steps.read_version_property.outputs.value}}-${{github.run_number}}-arm64.zip - path: orion-viewer/build/outputs/apk/arm64/dev/*.apk + name: orion-viewer-${{steps.read_version_property.outputs.value}}-${{github.run_number}}-arm64-debug.zip + path: orion-viewer/build/outputs/apk/arm64/debug/orion-viewer-${{steps.read_version_property.outputs.value}}-arm64-debug.apk - name: Upload x86 APK - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: - name: orion-viewer-dev-${{steps.read_version_property.outputs.value}}-${{github.run_number}}-x86.zip - path: orion-viewer/build/outputs/apk/x86/dev/*.apk + name: orion-viewer-${{steps.read_version_property.outputs.value}}-${{github.run_number}}-x86-debug.zip + path: orion-viewer/build/outputs/apk/x86/debug/orion-viewer-${{steps.read_version_property.outputs.value}}-x86-debug.apk - name: Upload x86_64 APK - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 + with: + name: orion-viewer-${{steps.read_version_property.outputs.value}}-${{github.run_number}}-x86_64-debug.zip + path: orion-viewer/build/outputs/apk/x86_64/debug/orion-viewer-${{steps.read_version_property.outputs.value}}-x86_64-debug.apk + + test: + runs-on: ubuntu-latest + strategy: + matrix: + api-level: [29] + steps: + - name: checkout + uses: actions/checkout@v3 + + - name: Gradle cache + uses: gradle/gradle-build-action@v2 + + - name: AVD cache + uses: actions/cache@v3 + 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 }} + 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 tests + uses: reactivecircus/android-emulator-runner@v2 with: - name: orion-viewer-dev-${{steps.read_version_property.outputs.value}}-${{github.run_number}}-x86_64.zip - path: orion-viewer/build/outputs/apk/x86_64/dev/*.apk + api-level: ${{ matrix.api-level }} + 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 \ No newline at end of file diff --git a/orion-viewer/build.gradle b/orion-viewer/build.gradle index 1881b43c0..039ec6708 100644 --- a/orion-viewer/build.gradle +++ b/orion-viewer/build.gradle @@ -96,14 +96,6 @@ android { signingConfig signingConfigs.release } } - - // CI configuration - dev { - matchingFallbacks = ['debug'] - debuggable = true - applicationIdSuffix ".dev" - signingConfig signingConfigs.debug - } } flavorDimensions "arch"