Skip to content

Commit

Permalink
chore: build only the sdk when possible (#62)
Browse files Browse the repository at this point in the history
* chore: build only the sdk when possible

* Fetch other branches and commits
  • Loading branch information
gastonfournier authored Jul 24, 2024
1 parent 39b2a6d commit 812f882
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 464 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,27 @@ jobs:
steps:
- uses: actions/checkout@v4
name: Checkout code
with:
fetch-depth: 2 # Checkout HEAD^
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: gradle
- name: Build and test
- name: Check for changes in app directory
id: check-changes
run: |
CHANGED=$(git diff --name-only HEAD^...HEAD -- app/)
if [ -z "$CHANGED" ]; then
echo "No changes in app/ directory."
echo "skip-build-app=true" >> $GITHUB_ENV
fi
- name: Build and test SDK
if: env.skip-build-app == 'true'
run: ./gradlew unleashandroidsdk:build unleashandroidsdk:jacocoTestReport
- name: Build and test all
if: env.skip-build-app != 'true'
run: ./gradlew build jacocoTestReport
- name: Coveralls
uses: coverallsapp/github-action@v2
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/prs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,27 @@ jobs:
steps:
- uses: actions/checkout@v4
name: Checkout code
with:
fetch-depth: 0
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: gradle
- name: Build and test
- name: Check for changes in app directory
id: check-changes
run: |
CHANGED=$(git diff --name-only origin/main...HEAD -- app/)
if [ -z "$CHANGED" ]; then
echo "No changes in app/ directory."
echo "skip-build-app=true" >> $GITHUB_ENV
fi
- name: Build and test SDK
if: env.skip-build-app == 'true'
run: ./gradlew unleashandroidsdk:build unleashandroidsdk:jacocoTestReport
- name: Build and test all
if: env.skip-build-app != 'true'
run: ./gradlew build jacocoTestReport
- name: Coveralls
uses: coverallsapp/github-action@v2
Expand Down
9 changes: 0 additions & 9 deletions unleashandroidsdk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@ dependencies {
testImplementation(libs.okhttp.mockserver)
testImplementation(libs.awaitility)
testImplementation(libs.jsonunit)
androidTestImplementation(libs.kotlinx.coroutines.test)
androidTestImplementation(libs.assertj)
androidTestImplementation(libs.mockito)
androidTestImplementation(libs.androidx.work.testing)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(libs.okhttp.mockserver)
}

publishing {
Expand Down Expand Up @@ -180,8 +173,6 @@ val jacocoTestReport by tasks.register<JacocoReport>("jacocoTestReport") {

sourceDirectories.setFrom(files("${projectDir}/src/main/java"))
classDirectories.setFrom(listOf(
fileTree("${buildDir}/classes", fileTreeConfig),
fileTree("${buildDir}/intermediates/javac/debug", fileTreeConfig),
fileTree("${buildDir}/tmp/kotlin-classes/debug", fileTreeConfig)
))
executionData.setFrom(fileTree(buildDir) {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

84 changes: 0 additions & 84 deletions unleashandroidsdk/src/androidTest/resources/edgeresponse.json

This file was deleted.

Loading

0 comments on commit 812f882

Please sign in to comment.