Skip to content

Commit

Permalink
ci: added canary workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
yeung-wah committed Jun 16, 2022
1 parent 1375235 commit a448653
Show file tree
Hide file tree
Showing 42 changed files with 1,004 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,37 @@
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1

orbs:
getting-started-smoke-test:
orbs:
android: circleci/android@2.0.0

jobs:
android:
working_directory: ~/android-canaries/canaries/example
executor:
name: android/android-machine
resource-class: xlarge
tag: 2022.03.1
steps:
- checkout:
path: ~/android-canaries
- android/create-avd:
avd-name: myavd
install: true
system-image: system-images;android-29;default;x86
- android/start-emulator:
avd-name: myavd
- android/run-tests



workflows:
canaries:
# when:
# and:
# - equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
# - equal: [ "Canaries", << pipeline.schedule.name >> ]
jobs:
- getting-started-smoke-test/android
36 changes: 36 additions & 0 deletions canaries/example/.gitignore
@@ -0,0 +1,36 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties

#amplify-do-not-edit-begin
amplify/\#current-cloud-backend
amplify/.config/local-*
amplify/logs
amplify/mock-data
amplify/backend/amplify-meta.json
amplify/backend/.temp
build/
dist/
node_modules/
aws-exports.js
awsconfiguration.json
amplifyconfiguration.json
amplifyconfiguration.dart
amplify-build-config.json
amplify-gradle-config.json
amplifytools.xcconfig
.secret-*
**.sample
#amplify-do-not-edit-end
3 changes: 3 additions & 0 deletions canaries/example/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions canaries/example/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

139 changes: 139 additions & 0 deletions canaries/example/.idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions canaries/example/.idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions canaries/example/.idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions canaries/example/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions canaries/example/.idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions canaries/example/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions canaries/example/app/.gitignore
@@ -0,0 +1 @@
/build
46 changes: 46 additions & 0 deletions canaries/example/app/build.gradle
@@ -0,0 +1,46 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
}

android {
compileSdkVersion 31
buildToolsVersion "30.0.3"

defaultConfig {
applicationId "com.example.todo"
minSdkVersion 24
targetSdkVersion 31
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}

dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.amplifyframework:aws-api:+'
implementation 'com.amplifyframework:aws-datastore:+'
}
21 changes: 21 additions & 0 deletions canaries/example/app/proguard-rules.pro
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
@@ -0,0 +1,24 @@
package com.example.todo

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.example.todo", appContext.packageName)
}
}

0 comments on commit a448653

Please sign in to comment.