diff --git a/.circleci/config.yml b/.circleci/config.yml index 4593de71fc5..91480ba0df1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,35 +4,58 @@ version: 2.1 # Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects. orbs: - android: circleci/android@2.3.0 + android: circleci/android@2.4.0 codecov: codecov/codecov@3.3.0 jobs: # Below is the definition of your job to build and test your app, you can rename and customize it as you want. build-and-test: - # These next lines define the Android machine image executor: https://circleci.com/docs/2.0/executor-types/ - executor: - name: android/android-machine - resource-class: large - tag: 2023.11.1 + machine: true + resource_class: nightscout/android steps: - checkout - - android/change-java-version: - java-version: 17 + - run: + name: Create avd + command: | + echo "no" | /opt/android-sdk/cmdline-tools/latest/bin/avdmanager --verbose create avd -n citest -k "system-images;android-30;google_apis_playstore;x86" --force - - android/start-emulator-and-run-tests: - system-image: system-images;android-29;google_apis;x86 - # Compile while the emulator starts to use the time. - post-emulator-launch-assemble-command: ./gradlew compileFullDebugUnitTestSources compileFullDebugAndroidTestSources - test-command: ./gradlew connectedFullDebugAndroidTest + - run: + name: Launch emulator + command: | + export ANDROID_SDK_ROOT=/opt/android-sdk + export ANDROID_HOME=/opt/android-sdk + emulator -avd citest -delay-adb -verbose -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim + background: true - - android/run-tests: - test-command: ./gradlew testFullDebugUnitTest + - run: + name: Run connectedFullDebugAndroidTest + command: | + export ANDROID_SDK_ROOT=/opt/android-sdk + export ANDROID_HOME=/opt/android-sdk + env + ./gradlew -Dorg.gradle.jvmargs=-Xmx6g connectedFullDebugAndroidTest + + - run: + name: Kill emulators + command: | + echo "Killing emulators" + adb devices | grep emulator | cut -f1 | while read -r line; do adb -s $line emu kill; done + + - run: + name: Run testFullDebugUnitTest + command: | + export ANDROID_SDK_ROOT=/opt/android-sdk + export ANDROID_HOME=/opt/android-sdk + ./gradlew -Dorg.gradle.jvmargs=-Xmx6g testFullDebugUnitTest - - android/run-tests: - test-command: ./gradlew --stacktrace jacocoAllDebugReport + - run: + run: Run jacocoAllDebugReport + command: | + export ANDROID_SDK_ROOT=/opt/android-sdk + export ANDROID_HOME=/opt/android-sdk + ./gradlew --stacktrace jacocoAllDebugReport - run: name: Save test results diff --git a/.circleci/config.yml.cloud b/.circleci/config.yml.cloud new file mode 100644 index 00000000000..4593de71fc5 --- /dev/null +++ b/.circleci/config.yml.cloud @@ -0,0 +1,60 @@ +# Use the latest 2.1 version of CircleCI pipeline process engine. +# See: https://circleci.com/docs/2.0/configuration-reference +version: 2.1 + +# Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects. +orbs: + android: circleci/android@2.3.0 + codecov: codecov/codecov@3.3.0 + +jobs: + # Below is the definition of your job to build and test your app, you can rename and customize it as you want. + build-and-test: + # These next lines define the Android machine image executor: https://circleci.com/docs/2.0/executor-types/ + executor: + name: android/android-machine + resource-class: large + tag: 2023.11.1 + + steps: + - checkout + + - android/change-java-version: + java-version: 17 + + - android/start-emulator-and-run-tests: + system-image: system-images;android-29;google_apis;x86 + # Compile while the emulator starts to use the time. + post-emulator-launch-assemble-command: ./gradlew compileFullDebugUnitTestSources compileFullDebugAndroidTestSources + test-command: ./gradlew connectedFullDebugAndroidTest + + - android/run-tests: + test-command: ./gradlew testFullDebugUnitTest + + - android/run-tests: + test-command: ./gradlew --stacktrace jacocoAllDebugReport + + - run: + name: Save test results + command: | + mkdir -p ~/test-results/junit/ + find . -type f -regex ".*/build/outputs/androidTest-results/.*xml" -exec cp {} ~/test-results/junit/ \; + when: always + + - store_test_results: + path: ~/test-results + + - store_artifacts: + path: ~/test-results/junit + + - codecov/upload: + file: './build/reports/jacoco/jacocoAllDebugReport/jacocoAllDebugReport.xml' + +workflows: + # Below is the definition of your workflow. + # Inside the workflow, you provide the jobs you want to run, e.g this workflow runs the build-and-test job above. + # CircleCI will run this workflow on every commit. + # For more details on extending your workflow, see the configuration docs: https://circleci.com/docs/2.0/configuration-reference/#workflows + dotests: + jobs: + - build-and-test diff --git a/.github/ISSUE_TEMPLATE/custom.md b/.github/ISSUE_TEMPLATE/custom.md index 9f30207094c..3e085d67abe 100644 --- a/.github/ISSUE_TEMPLATE/custom.md +++ b/.github/ISSUE_TEMPLATE/custom.md @@ -15,5 +15,5 @@ Reporting bugs upper-right corner). - Obtain the app's log files, which can be found on the phone in _/storage/emulated/0/Android/data/info.nightscout.androidaps/_ - See https://wiki.aaps.app/en/latest/Usage/Accessing-logfiles.html + See https://wiki.aaps.app/en/latest/GettingHelp/AccessingLogFiles.html - Open an issue at https://github.com/nightscout/AndroidAPS/issues/new diff --git a/.gitignore b/.gitignore index 369da9db4c6..d386d2a5860 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ */output-metadata.json /build /captures +/java_pid* *.apk build/ !.idea/dictionaries/project-dictionary.xml @@ -26,3 +27,6 @@ app/pumpcontrol/* wear/aapsclient/* wear/aapsclient2/* wear/pumpcontrol/* +.kotlin/* +/*.log +*.preferences_pb diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index bf41126f8b9..680e62e6652 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,7 +1,7 @@