Skip to content

Commit

Permalink
fix(ci): test release build in emulator test
Browse files Browse the repository at this point in the history
Previously the debug build was tested, meaning proguard issues
would slip through and cause unexpected crashes

This adds a test keystore creation step so release signing works,
then switches to release mode gradle targets and toggles on release
build testing
  • Loading branch information
mikehardy committed Jun 21, 2024
1 parent 126e96b commit 7b5787b
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/tests_emulator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ jobs:
timeout-minutes: 75
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
TEST_RELEASE_BUILD: true
# could be better, '/home/runner' should be '~/' but neither that nor '$HOME' worked
STOREFILEDIR: /home/runner/src
STOREFILE: android-keystore
STOREPASS: testpass
KEYPASS: testpass
KEYALIAS: nrkeystorealias
strategy:
fail-fast: false
matrix:
Expand All @@ -33,6 +40,15 @@ jobs:
# This is useful for benchmarking, do 0, 1, 2, etc (up to 256 max job-per-matrix limit) for averages
iteration: [0]
steps:
- name: Test Credential Prep
run: |
echo "KSTOREPWD=$STOREPASS" >> $GITHUB_ENV
echo "KEYPWD=$KEYPASS" >> $GITHUB_ENV
mkdir $STOREFILEDIR
cd $STOREFILEDIR
echo y | keytool -genkeypair -dname "cn=AnkiDroid, ou=ankidroid, o=AnkiDroid, c=US" -alias $KEYALIAS -keypass $KEYPASS -keystore "$STOREFILE" -storepass $STOREPASS -keyalg RSA -validity 20000
shell: bash

- uses: actions/checkout@v4
with:
fetch-depth: 50
Expand Down Expand Up @@ -80,7 +96,7 @@ jobs:
timeout_minutes: 15
retry_wait_seconds: 60
max_attempts: 3
command: ./gradlew packagePlayDebug packagePlayDebugAndroidTest --daemon
command: ./gradlew packagePlayRelease packagePlayReleaseAndroidTest --daemon

- name: AVD Boot and Snapshot Creation
# Only generate a snapshot for saving if we are on main branch with a cache miss
Expand Down

0 comments on commit 7b5787b

Please sign in to comment.