Skip to content

Commit

Permalink
Merge pull request #29 from SecUSo/development
Browse files Browse the repository at this point in the history
Update to version 1.1.1
  • Loading branch information
udenr authored Oct 15, 2024
2 parents aed9c07 + 7a12dc9 commit 6dc2e37
Show file tree
Hide file tree
Showing 16 changed files with 250 additions and 63 deletions.
99 changes: 99 additions & 0 deletions .github/workflows/android-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Android Emulator Tests
on: [ push, pull_request ]

jobs:
check-if-tests-exist:
runs-on: ubuntu-latest
outputs:
status: ${{ steps.check-androidTest.outputs.NOT_EMPTY }}
min-sdk-version: ${{ steps.get-sdk-version.outputs.MIN_SDK_VERSION }}
target-sdk-version: ${{ steps.get-sdk-version.outputs.TARGET_SDK_VERSION }}
app-id: ${{ steps.get-app-id.outputs.APP_ID }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Check if androidTest folder is not empty
run: |
echo "NOT_EMPTY=$([ "$(ls -A app/src/androidTest)" ] && echo 'true' || echo 'false')"
echo "NOT_EMPTY=$([ "$(ls -A app/src/androidTest)" ] && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
id: check-androidTest
- name: Get min and target sdk
if: steps.check-androidTest.outputs.NOT_EMPTY == 'true'
id: get-sdk-version
run: |
echo "MIN_SDK_VERSION=$(cat app/build.gradle | grep minSdkVersion | rev | cut -d' ' -f 1 | rev)" >> $GITHUB_OUTPUT
echo "TARGET_SDK_VERSION=$(cat app/build.gradle | grep targetSdkVersion | rev | cut -d' ' -f 1 | rev)" >> $GITHUB_OUTPUT
- name: Get app ID
id: get-app-id
run: |
echo "APP_ID=$(cat app/build.gradle | grep applicationId | rev | cut -d' ' -f 1 | rev | tr -d '"')" >> $GITHUB_OUTPUT
test:
needs: check-if-tests-exist
if: needs.check-if-tests-exist.outputs.status == 'true'
runs-on: ubuntu-latest
strategy:
matrix:
api-level: [34, "${{ needs.check-if-tests-exist.outputs.min-sdk-version }}", "${{ needs.check-if-tests-exist.outputs.target-sdk-version }}"]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Enable KVM group perms
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: Gradle cache
uses: gradle/gradle-build-action@v3

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

- name: Set up JDK environment
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17

- 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.api-level >= 30 && 'google_apis' || 'default' }}
arch: ${{ matrix.api-level < 21 && 'x86' || 'x86_64' }}
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 connected tests
uses: ReactiveCircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.api-level >= 30 && 'google_apis' || 'default' }}
arch: ${{ matrix.api-level < 21 && 'x86' || 'x86_64' }}
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: |
adb uninstall ${{needs.check-if-tests-exist.outputs.app-id}} || true
adb uninstall ${{needs.check-if-tests-exist.outputs.app-id}}.test || true
adb uninstall ${{needs.check-if-tests-exist.outputs.app-id}}.androidTest || true
chmod +x gradlew
./gradlew :app:connectedCheck --stacktrace
adb uninstall ${{needs.check-if-tests-exist.outputs.app-id}} || true
adb uninstall ${{needs.check-if-tests-exist.outputs.app-id}}.test || true
adb uninstall ${{needs.check-if-tests-exist.outputs.app-id}}.androidTest || true
3 changes: 2 additions & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Changelog Generation

on:
release:
types: [published, released]
types: [published]
workflow_dispatch:

jobs:
Expand All @@ -16,6 +16,7 @@ jobs:
- uses: rhysd/changelog-from-release/action@v3
with:
file: CHANGELOG.md
pull_request: true
github_token: ${{ secrets.GITHUB_TOKEN }}
commit_summary_template: 'update changelog for %s changes'
args: -l 2
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Continuous Integration
on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: "recursive"

- name: Set up JDK environment
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: 17

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Run local unit tests
run: bash ./gradlew test --stacktrace

build:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: "recursive"

- name: Set up JDK environment
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: 17

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Run lint check
run: bash ./gradlew lint

- name: Upload lint result
uses: actions/upload-artifact@v4
with:
name: lint-results-debug
path: app/build/reports/lint-results-debug.html

- name: Build the app
run: bash ./gradlew build --stacktrace

- name: Build debug apk
run: bash ./gradlew assembleDebug

- name: Upload debug apk
uses: actions/upload-artifact@v4
with:
name: debug-apk
path: app/build/outputs/apk/debug/*.apk
2 changes: 0 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[submodule "libs/privacy-friendly-backup-api"]
path = libs/privacy-friendly-backup-api
url = [email protected]:SecUSo/privacy-friendly-backup-api.git
[submodule "libs/privacy-friendly-backup-api/"]
url = https://github.com/SecUSo/privacy-friendly-backup-api.git
36 changes: 17 additions & 19 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 33
defaultConfig {
applicationId 'org.secuso.privacyfriendlytapemeasure'
minSdkVersion 21
targetSdkVersion 33
versionCode 4
versionName '1.1'
compileSdk 34
targetSdkVersion 34
versionCode 5
versionName '1.1.1'
}
buildTypes {
release {
Expand All @@ -18,32 +18,30 @@ android {
}
productFlavors {
}
namespace 'org.secuso.privacyfriendlycameraruler'
lint {
lintConfig = file("lint.xml")
}
kotlin {
jvmToolchain(17)
}
}

dependencies {
testImplementation 'junit:junit:4.12'
implementation 'androidx.appcompat:appcompat:1.0.0'
testImplementation 'junit:junit:4.13.2'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.drawerlayout:drawerlayout:1.2.0'
implementation 'androidx.fragment:fragment:1.6.0'
implementation 'androidx.fragment:fragment-ktx:1.8.3'
implementation 'androidx.viewpager:viewpager:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.getbase:floatingactionbutton:1.10.1'

// Backup
implementation project(path: ':backup-api')
def work_version = "2.4.0"
def work_version = "2.9.1"
implementation "androidx.work:work-runtime:$work_version"
implementation "androidx.work:work-runtime-ktx:$work_version"
androidTestImplementation "androidx.work:work-testing:$work_version"
implementation 'androidx.sqlite:sqlite-ktx:2.3.1'

constraints {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") {
because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib")
}
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") {
because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
}
}
implementation 'androidx.sqlite:sqlite-ktx:2.4.0'
}
10 changes: 10 additions & 0 deletions app/lint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<!-- Disable the NotificationPermission check for glide -->
<issue id="NotificationPermission">
<ignore regexp="com.bumptech.glide.request.target.NotificationTarget" />
</issue>

<!-- Set the severity of missing translations to warning instead of error -->
<issue id="MissingTranslation" severity="warning" />
</lint>

This file was deleted.

6 changes: 3 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.secuso.privacyfriendlycameraruler">
xmlns:tools="http://schemas.android.com/tools">

<supports-screens
android:anyDensity="true"
Expand All @@ -12,7 +11,8 @@
android:xlargeScreens="true" />

<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />

<application
android:name=".PFTapeMeasure"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class PFTapeMeasure : Application(), Configuration.Provider {
BackupManager.backupRestorer = BackupRestorer()
}

override fun getWorkManagerConfiguration(): Configuration {
return Configuration.Builder().setMinimumLoggingLevel(Log.INFO).build()
}
override val workManagerConfiguration = Configuration.Builder().setMinimumLoggingLevel(Log.INFO).build()

}
Loading

0 comments on commit 6dc2e37

Please sign in to comment.