Skip to content

Commit d6afeda

Browse files
committed
Add memory to emulator and update TSLs during build
1 parent e93e032 commit d6afeda

File tree

1 file changed

+27
-7
lines changed

1 file changed

+27
-7
lines changed

codemagic.yaml

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ workflows:
133133
script: |
134134
# Not running 'fetchAndPackageDefaultConfiguration' for repo.ria as necessary files are already setup
135135
if [[ ! "${{ inputs.defaultCentralConfigurationTslUrl_input }}" == *"10.1.24.31"* ]]; then
136-
./gradlew clean --no-daemon fetchAndPackageDefaultConfiguration --args="${{ inputs.defaultCentralConfigurationUrl_input }} ${{ inputs.defaultCentralConfigurationUpdateInterval_input }}"
136+
./gradlew clean --no-daemon fetchAndPackageDefaultConfiguration --args="${{ inputs.defaultCentralConfigurationUrl_input }} ${{ inputs.defaultCentralConfigurationUpdateInterval_input }}" -Dorg.gradle.jvmargs="-Xmx4g"
137137
else
138138
echo "Skipping default configuration fetching for repo.ria"
139139
fi
@@ -145,15 +145,15 @@ workflows:
145145
- name: Launch emulator for instrumented tests
146146
script: |
147147
cd $ANDROID_HOME/tools
148-
emulator -avd emulator-35 &
148+
emulator -avd emulator-35 -memory 4096 &
149149
adb wait-for-device
150150
when:
151151
condition: ${{ inputs.enableTests_input }}
152152
- name: Run instrumented tests
153153
script: |
154154
set -e
155155
cd $CM_BUILD_DIR
156-
./gradlew clean createDebugCoverageReport -Dorg.gradle.jvmargs="-Xmx4g"
156+
./gradlew connectedDebugAndroidTest -Dorg.gradle.jvmargs="-Xmx4g"
157157
adb logcat -d > emulator.log
158158
when:
159159
condition: ${{ inputs.enableTests_input }}
@@ -216,22 +216,42 @@ workflows:
216216
-dname "CN=Debug,O=Debug,C=EE"
217217
218218
echo "Debug keystore created at $DEBUG_KEYSTORE_PATH"
219-
- name: Fetch default configuration
219+
- name: Fetch default configuration and setup TSLs
220220
script: |
221-
./gradlew clean --no-daemon fetchAndPackageDefaultConfiguration
221+
./gradlew clean --no-daemon fetchAndPackageDefaultConfiguration -Dorg.gradle.jvmargs="-Xmx4g"
222+
223+
TSL_FILES_DIR=config-lib/src/main/assets/tslFiles
224+
225+
# Create TSLs folder
226+
mkdir -p $TSL_FILES_DIR
227+
228+
# Remove current eu-lotl.xml if it exists
229+
rm -f $TSL_FILES_DIR/eu-lotl.xml
230+
231+
# Download latest 'eu-lotl' file
232+
echo "Downloading latest 'eu-lotl.xml' file"
233+
wget "https://ec.europa.eu/tools/lotl/eu-lotl.xml" -P $TSL_FILES_DIR
234+
235+
echo "Getting TSL (remote LOTL)"
236+
python3 scripts/TSLXMLDownloader.py --tslFile="$TSL_FILES_DIR/$(basename 'https://ec.europa.eu/tools/lotl/eu-lotl.xml')" --tslTestFile="$TSL_FILES_DIR/$(basename 'https://ec.europa.eu/tools/lotl/eu-lotl.xml')" --countries="EE" --isDevBuild="False"
237+
echo "Finished downloading TSL"
238+
239+
echo "Moving TSLs to app's assets"
240+
mv -v scripts/TSL/* $TSL_FILES_DIR/
241+
echo "Done moving TSLs"
222242
- name: Run tests
223243
script: |
224244
./gradlew test
225245
- name: Launch emulator for instrumented tests
226246
script: |
227247
cd $ANDROID_HOME/tools
228-
emulator -avd emulator-35 &
248+
emulator -avd emulator-35 -memory 4096 &
229249
adb wait-for-device
230250
- name: Run instrumented tests
231251
script: |
232252
set -e
233253
cd $CM_BUILD_DIR
234-
./gradlew clean createDebugCoverageReport -Dorg.gradle.jvmargs="-Xmx4g"
254+
./gradlew clean connectedDebugAndroidTest -Dorg.gradle.jvmargs="-Xmx4g"
235255
adb logcat -d > emulator.log
236256
- name: Build RIA DigiDoc
237257
script: |

0 commit comments

Comments
 (0)