Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Test build

# Builds a "Numio Test" APK for trying changes on a phone before a release.
# It installs next to the real Numio (different app id), so nothing gets replaced.
# Release APKs are still built and signed by hand, not here.

on:
push:
branches-ignore: [main]
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21

- uses: gradle/actions/setup-gradle@v4

# Only changes the copy on this build machine, never the repo:
# app id com.rr.numio.test and the name "Numio Test".
- name: Make it a test app
run: |
sed -i 's/applicationId = "com.rr.numio"/applicationId = "com.rr.numio.test"/' app/build.gradle.kts
sed -i 's#<string name="app_name">Numio</string>#<string name="app_name">Numio Test</string>#' app/src/main/res/values/strings.xml
grep -n 'applicationId' app/build.gradle.kts
grep -n 'app_name' app/src/main/res/values/strings.xml

- name: Run unit tests
run: ./gradlew testDebugUnitTest --stacktrace

- name: Build test APK
run: ./gradlew assembleDebug --stacktrace

- name: Check no internet permission
run: |
AAPT=$(ls $ANDROID_HOME/build-tools/*/aapt | tail -1)
if $AAPT dump permissions app/build/outputs/apk/debug/app-debug.apk | grep -q 'android.permission.INTERNET'; then
echo "INTERNET permission found - Numio must stay offline"; exit 1
fi
echo "No INTERNET permission"

- uses: actions/upload-artifact@v4
with:
name: NumioTest-${{ github.sha }}
path: app/build/outputs/apk/debug/app-debug.apk
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ android {
applicationId = "com.rr.numio"
minSdk = 24
targetSdk = 36
versionCode = 8
versionName = "1.0.7"
versionCode = 9
versionName = "1.0.8"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

Expand Down
Loading
Loading