Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 48 additions & 50 deletions .github/workflows/petJournalAndroid.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
name: PetJournalAndroid
name: Build Pipeline

on:
push:
branches:
- develop
pull_request:
branches: [ "develop" ]


jobs:
lint:
name: Static Code Analysis
name: Lint Codebase
runs-on: ubuntu-latest
steps:
- name: Checkout the code
Expand All @@ -19,63 +18,62 @@ jobs:
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- name: Grant execute permission for gradlew
run: chmod +x gradlew
working-directory: petJournal

- name: Run lint
- name: Run Lint Analysis
run: ./gradlew lintDebug
working-directory: petJournal

- name: Upload lint report
- name: Upload Lint Report
uses: actions/upload-artifact@v4
with:
name: lint-results-debug.html
name: Lint Report
path: petJournal/app/build/reports/lint-results-debug.html

unit-test:
name: Unit Tests
runs-on: ubuntu-latest
needs: lint
steps:
- name: Checkout the code
uses: actions/checkout@v4.1.1

- name: Set up JDK 17
uses: actions/setup-java@v4.0.0
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Grant execute permission for gradlew
run: chmod +x gradlew
working-directory: petJournal

- name: Cache Gradle dependencies
uses: actions/cache@v4
with:
path: ~/.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('petJournal/**/*') }}
restore-keys: |
${{ runner.os }}-gradle-
env:
JAVA_HOME: /opt/hostedtoolcache/Java_1.8.0

- name: Run unit tests
run: ./gradlew test
working-directory: petJournal

- name: Upload unit tests report
uses: actions/upload-artifact@v4
with:
name: unit_test_report
path: petJournal/app/build/reports/tests/testDebugUnitTest/
#unit-test:
# name: Unit Tests
# runs-on: ubuntu-latest
# needs: lint
# steps:
# - name: Checkout the code
# uses: actions/checkout@v4.1.1

# - name: Set up JDK 17
# uses: actions/setup-java@v4.0.0
# with:
# java-version: '17'
# distribution: 'temurin'
# cache: 'gradle'

# - name: Setup Android SDK
# uses: android-actions/setup-android@v3

# - name: Grant execute permission for gradlew
# run: chmod +x gradlew
# working-directory: petJournal

# - name: Cache Gradle dependencies
# uses: actions/cache@v4
# with:
# path: ~/.gradle
# key: ${{ runner.os }}-gradle-${{ hashFiles('petJournal/**/*') }}
# restore-keys: |
# ${{ runner.os }}-gradle-
# env:
# JAVA_HOME: /opt/hostedtoolcache/Java_1.8.0

# - name: Run unit tests
# run: ./gradlew test
# working-directory: petJournal

# - name: Upload unit tests report
# uses: actions/upload-artifact@v4
# with:
# name: unit_test_report
# path: petJournal/app/build/reports/tests/testDebugUnitTest/


# package:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private fun TextFieldSingleView(index: Int, text: String, isError: Boolean = fal
.height(35.sdp)
.offset(
y = if (text.isNotEmpty()) {
if (index == text.length -1) 0.sdp else 20.sdp
if (index == text.length - 1) 0.sdp else 20.sdp
} else {
0.sdp
}
Expand All @@ -139,19 +139,19 @@ private fun TextFieldSingleView(index: Int, text: String, isError: Boolean = fal
)
)

drawRoundRect(
color = if (isError && text.length == 6) Color.Transparent
else if (text.length < 6 && text.isNotEmpty() && index == text.length -1) Color.Transparent
else colorBorder,
style = stroke,
cornerRadius = CornerRadius(10.dp.toPx())
)
drawRoundRect(
color = if (isError && text.length == 6) Color.Transparent
else if (text.length < 6 && text.isNotEmpty() && index == text.length - 1) Color.Transparent
else colorBorder,
style = stroke,
cornerRadius = CornerRadius(10.dp.toPx())
)

}
.border(
1.sdp,
if (isError && text.length == 6) MaterialTheme.colorScheme.error
else if (text.length < 6 && text.isNotEmpty() && index == text.length -1) MaterialTheme.colorScheme.primary
else if (text.length < 6 && text.isNotEmpty() && index == text.length - 1) MaterialTheme.colorScheme.primary
else Color.Transparent,
shape = RoundedCornerShape(10.sdp)
)
Expand Down
8 changes: 4 additions & 4 deletions petJournal/data/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ dependencies {
implementation(dependencies["coreKtx"]!!)
implementation(dependencies["preference"]!!)

testImplementation("junit:junit")
testImplementation("io.mockk:mockk")
testImplementation("com.willowtreeapps.assertk:assertk")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test")
testImplementation(rootProject.ext["testJunit"] as String)
testImplementation(rootProject.ext["testMockk"] as String)
testImplementation(rootProject.ext["testAssertk"] as String)
testImplementation(rootProject.ext["testKotlinxCoroutines"] as String)
}