diff --git a/.github/fake-google-services.json b/.github/fake-google-services.json new file mode 100644 index 0000000..b0d249d --- /dev/null +++ b/.github/fake-google-services.json @@ -0,0 +1,40 @@ +{ + "project_info": { + "project_number": "1092521184945", + "firebase_url": "https://dev-personal-XXX.firebaseio.com", + "project_id": "dev-personal-XXX", + "storage_bucket": "dev-personal-XXX.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:1092521184945:android:af137629aab59de5af1c90", + "android_client_info": { + "package_name": "to.dev.dev_android.debug" + } + }, + "oauth_client": [ + { + "client_id": "XX.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "XXX" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "XXX.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/.github/workflows/runOnGitHub.yml b/.github/workflows/runOnGitHub.yml new file mode 100644 index 0000000..5ce3205 --- /dev/null +++ b/.github/workflows/runOnGitHub.yml @@ -0,0 +1,31 @@ +# .github/workflows/runOnGitHub.yml +# GitHub Actions documentation +# => https://docs.github.com/en/actions +name: runOnGitHub + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [ master, main ] + pull_request: + branches: [ master, main ] +jobs: + gradle: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Copy fake google-services.json + run: cp -f .github/fake-google-services.json app/google-services.json + - uses: actions/setup-java@v1 + with: + java-version: 8 + + # Execute Gradle commands in GitHub Actions workflows + # => https://github.com/marketplace/actions/gradle-command + - uses: eskatos/gradle-command-action@v1 + with: + arguments: runOnGitHub + wrapper-cache-enabled: true + dependencies-cache-enabled: true + configuration-cache-enabled: true diff --git a/app/src/test/java/to/dev/dev_android/view/main/view/MainActivityTest.kt b/app/src/test/java/to/dev/dev_android/view/main/view/MainActivityTest.kt index 7912322..89b778c 100644 --- a/app/src/test/java/to/dev/dev_android/view/main/view/MainActivityTest.kt +++ b/app/src/test/java/to/dev/dev_android/view/main/view/MainActivityTest.kt @@ -6,8 +6,15 @@ import org.junit.Assert.* class MainActivityTest { + @Test + fun `2 plus 2 equals 4`() { + assertEquals(2+2, 4) + } + @Test fun onCreate() { + + } @Test diff --git a/build.gradle.kts b/build.gradle.kts index 1855aac..6bfae41 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -78,3 +78,10 @@ detekt { tasks.named("wrapper") { distributionType = Wrapper.DistributionType.ALL } + +tasks.register("runOnGitHub") { + // Documentation: https://guides.gradle.org/writing-gradle-tasks/ + dependsOn(":app:testDebugUnitTest") + group = "custom" + description = "$ ./gradlew runOnGitHub # runs on GitHub Action" +} \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index 15a801b..247fe5d 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1 +1,13 @@ +plugins { + id("com.gradle.enterprise").version("3.1.1") +} + +gradleEnterprise { + buildScan { + termsOfServiceUrl = "https://gradle.com/terms-of-service" + termsOfServiceAgree = "yes" + publishOnFailure() + } +} + include(":app")