Skip to content

Commit

Permalink
~
Browse files Browse the repository at this point in the history
  • Loading branch information
max-kammerer committed Sep 28, 2023
1 parent ab3dbe8 commit 1c532aa
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 27 deletions.
73 changes: 54 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/[email protected]
Expand All @@ -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
8 changes: 0 additions & 8 deletions orion-viewer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,6 @@ android {
signingConfig signingConfigs.release
}
}

// CI configuration
dev {
matchingFallbacks = ['debug']
debuggable = true
applicationIdSuffix ".dev"
signingConfig signingConfigs.debug
}
}

flavorDimensions "arch"
Expand Down

0 comments on commit 1c532aa

Please sign in to comment.