Skip to content

Commit

Permalink
TECH: added new github workflow; use kaspresso snapshot dependency if…
Browse files Browse the repository at this point in the history
… property is set
  • Loading branch information
Nikitae57 committed Jan 11, 2023
1 parent 0c8a47a commit 120a292
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 8 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/snapshot_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This workflow is triggered manually before release

name: Snapshot Checks

on: workflow_dispatch

jobs:
snapshot-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 11
- name: Assemble projects
run: ./gradlew -PsnapshotTesting=true assembleDebugAndroidTest
6 changes: 6 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@ androidXTest = "1.5.0"
testOrchestrator = "1.4.2"
lifecycle = "2.5.1"
thirdPartyReport = "0.17.798"
kaspressoSnapshotVersion = "1.5.1-SNAPSHOT"

[libraries]
# kaspresso snapshots for release checks
kaspressoSnapshot = { module = "com.kaspersky.android-components:kaspresso", version.ref = "kaspressoSnapshotVersion" }
allureSupportSnapshot = { module = "com.kaspersky.android-components:kaspresso-allure-support", version.ref = "kaspressoSnapshotVersion" }
composeSupportSnapshot = { module = "com.kaspersky.android-components:kaspresso-compose-support", version.ref = "kaspressoSnapshotVersion" }

# plugins
kotlinPlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
androidPlugin = "com.android.tools.build:gradle:7.2.2"
Expand Down
10 changes: 8 additions & 2 deletions samples/kaspresso-allure-support-sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@ dependencies {
implementation(libs.constraint)
implementation(libs.multidex)

androidTestImplementation(projects.kaspresso)
androidTestImplementation(projects.allureSupport)
// kaspresso
if (hasProperty("snapshotTesting")) {
androidTestImplementation(libs.kaspressoSnapshot)
androidTestImplementation(libs.allureSupportSnapshot)
} else {
androidTestImplementation(projects.kaspresso)
androidTestImplementation(projects.allureSupport)
}

androidTestImplementation(libs.androidXTestExtJunitKtx)
androidTestImplementation(libs.androidXTestExtJunit)
Expand Down
17 changes: 13 additions & 4 deletions samples/kaspresso-compose-support-sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,23 @@ dependencies {
implementation(libs.lifecycleViewModelComposeKtx)
implementation(libs.composeRuntimeLiveData)

androidTestImplementation(projects.kaspresso)
androidTestImplementation(projects.composeSupport)
// kaspresso
if (hasProperty("snapshotTesting")) {
testImplementation(libs.kaspressoSnapshot)
testImplementation(libs.composeSupportSnapshot)
androidTestImplementation(libs.kaspressoSnapshot)
androidTestImplementation(libs.composeSupportSnapshot)
} else {
testImplementation(projects.kaspresso)
testImplementation(projects.composeSupport)
androidTestImplementation(projects.kaspresso)
androidTestImplementation(projects.composeSupport)
}

androidTestImplementation(libs.androidXTestRunner)
androidTestImplementation(libs.junit)
androidTestImplementation(libs.composeUiTestJunit)

testImplementation(projects.kaspresso)
testImplementation(projects.composeSupport)
testImplementation(libs.androidXTestRunner)
testImplementation(libs.junit)
testImplementation(libs.composeUiTestJunit)
Expand Down
12 changes: 10 additions & 2 deletions samples/kaspresso-sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,22 @@ dependencies {
implementation(libs.androidXLifecycleRuntimeKtx)

androidTestImplementation(libs.junit)
androidTestImplementation(projects.kaspresso)

// kaspresso
if (hasProperty("snapshotTesting")) {
androidTestImplementation(libs.kaspressoSnapshot)
testImplementation(libs.kaspressoSnapshot)
} else {
androidTestImplementation(projects.kaspresso)
testImplementation(projects.kaspresso)
}

androidTestImplementation(libs.androidXTestRunner)
androidTestImplementation(libs.androidXTestRules)
androidTestImplementation(libs.androidXTestExtJunitKtx)
androidTestImplementation(libs.androidXTestExtJunit)

testImplementation(libs.junit)
testImplementation(projects.kaspresso)
testImplementation(libs.androidXTestRunner)
testImplementation(libs.androidXTestRules)
testImplementation(libs.androidXTestExtJunitKtx)
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ dependencyResolutionManagement {
mavenLocal()
google()
maven { url = uri("https://kotlin.bintray.com/kotlinx") }
maven { url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots") }
}
}

Expand Down

0 comments on commit 120a292

Please sign in to comment.