Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #131 from burhanrashid52/add_circle_ci
Added circle ci
- Loading branch information
Showing
6 changed files
with
118 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
version: 2 | ||
jobs: | ||
build: | ||
working_directory: ~/code | ||
docker: | ||
- image: circleci/android:api-28-alpha | ||
environment: | ||
JVM_OPTS: -Xmx3200m | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} | ||
- run: | ||
name: Chmod permissions | ||
command: sudo chmod +x ./gradlew | ||
- run: | ||
name: Accept licenses | ||
command: yes | sdkmanager --licenses || true | ||
- run: | ||
name: Download Dependencies | ||
command: ./gradlew androidDependencies | ||
- save_cache: | ||
paths: | ||
- ~/.gradle | ||
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} | ||
- run: | ||
name: Lists installed targets | ||
command: android list target | ||
environment: | ||
TERM: dumb | ||
- run: | ||
name: Show list of system-images | ||
command: sdkmanager --list --verbose | grep system-images | ||
- run: | ||
name: Setup Emulator | ||
command: sdkmanager "system-images;android-21;default;armeabi-v7a" && echo "no" | avdmanager create avd -n test -k "system-images;android-21;default;armeabi-v7a" | ||
- run: | ||
name: Launch Emulator | ||
command: | | ||
cd ${ANDROID_HOME}/emulator;ls | ||
export LD_LIBRARY_PATH=${ANDROID_HOME}/emulator/lib64:${ANDROID_HOME}/emulator/lib64/qt/lib | ||
emulator -avd test -no-window -noaudio -no-boot-anim -no-window -accel on | ||
background: true | ||
- run: | ||
name: Wait emulator | ||
command: | | ||
circle-android wait-for-boot | ||
adb shell input keyevent 82 | ||
- run: | ||
name: Run Espresso UI Tests | ||
command: ./gradlew :app:connectedDebugAndroidTest | ||
- run: | ||
name: Run UnitTest | ||
command: ./gradlew testDebugUnitTest | ||
- store_artifacts: | ||
path: app/build/reports | ||
destination: reports | ||
- store_artifacts: | ||
path: app/build/outputs/apk | ||
destination: apks | ||
- store_test_results: | ||
path: app/build/test-results |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
app/src/androidTest/java/com/burhanrashid52/imageeditor/EditImageActivityTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.burhanrashid52.imageeditor; | ||
|
||
import android.support.test.filters.LargeTest; | ||
import android.support.test.rule.ActivityTestRule; | ||
import android.support.test.runner.AndroidJUnit4; | ||
|
||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static android.support.test.espresso.Espresso.onView; | ||
import static android.support.test.espresso.assertion.ViewAssertions.matches; | ||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; | ||
import static android.support.test.espresso.matcher.ViewMatchers.withText; | ||
|
||
|
||
@RunWith(AndroidJUnit4.class) | ||
@LargeTest | ||
public class EditImageActivityTest { | ||
|
||
@Rule | ||
public ActivityTestRule<EditImageActivity> mActivityRule = new ActivityTestRule<>(EditImageActivity.class); | ||
|
||
@Test | ||
public void checkIfActivityIsLaunched() { | ||
onView(withText(R.string.app_name)).check(matches(isDisplayed())); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
app/src/test/java/com/burhanrashid52/imageeditor/SampleTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.burhanrashid52.imageeditor; | ||
|
||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
public class SampleTest { | ||
|
||
@Test | ||
public void testAddition() { | ||
assertEquals(6, 3 + 3); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters