Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update #18

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
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
35 changes: 19 additions & 16 deletions .github/workflows/ci_pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,40 @@
name: cute-cat-gallery-ci-pipeline
on:
pull_request:
branches: [main, develop]
branches: [ main, develop ]
push:
branches: [main, develop]
branches: [ main, develop ]
jobs:
build:
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v4.1.0

- name: Setup Java JDK
uses: actions/setup-java@v3.13.0
with:
java-version: '17'
distribution: 'adopt'
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Gradle Build Action
uses: gradle/gradle-build-action@v2.9.0
with:
arguments: build
gradle-version: 7.6
- name: Run KLint

- name: Setup Gradle
uses: gradle/gradle-build-action@v2.9.0
with:
arguments: ktlintCheck
gradle-version: 7.6
gradle-version: 8.1.1

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Build
run: ./gradlew assembleDebug

- name: Run Lint
run: ./gradlew ktlintCheck

- name: Run Tests
uses: gradle/gradle-build-action@v2.9.0
with:
arguments: test
gradle-version: 7.6
run: ./gradlew testDebugUnitTest

- name: Upload a Build Artifact
uses: actions/upload-artifact@v3.1.3
with:
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,7 @@ crashlytics-build.properties
fabric.properties

### AndroidStudio Patch ###

!/gradle/wrapper/gradle-wrapper.jar
!gradle/wrapper/gradle-wrapper.jar

### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
Expand Down
16 changes: 14 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ plugins {

android {
compileSdk 34

packagingOptions {
exclude 'META-INF/INDEX.LIST'
}
defaultConfig {
applicationId "com.luishenrique.cutecatsgallery"
minSdkVersion 21
Expand Down Expand Up @@ -61,13 +63,17 @@ dependencies {
implementation "androidx.compose.material:material-android:1.5.3"
implementation "io.coil-kt:coil-compose:2.4.0"
implementation "androidx.navigation:navigation-compose:2.7.4"
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.1'
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.1'
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
androidTestImplementation platform("androidx.compose:compose-bom:2023.10.00")
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"

implementation 'com.google.accompanist:accompanist-swiperefresh:0.32.0'

implementation 'com.google.guava:guava:27.0.1-android'

// progressbar cat
implementation "com.roger.catloadinglibrary:catloadinglibrary:1.0.9"

Expand All @@ -83,10 +89,16 @@ dependencies {
// viewModel
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2"

// Testng
implementation "org.testng:testng:$testng_version"

// Mockk
testImplementation "io.mockk:mockk:$mockk_version"

implementation "androidx.core:core-ktx:1.12.0"
implementation "com.google.android.material:material:1.10.0"
implementation "androidx.appcompat:appcompat:1.6.1"
testImplementation "junit:junit:4.13.2"
testImplementation "junit:junit:*"
androidTestImplementation "androidx.test.ext:junit:1.1.5"
androidTestImplementation "androidx.test.espresso:espresso-core:3.5.1"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.luishenrique.cutecatsgallery.home.presentation

import org.junit.Before
import org.junit.Test

class HomeViewModelTest {

// private lateinit var viewModel: HomeViewModel

@Before
fun before() {
// viewModel = null
}

// @Test
// fun `given getCats method when call it then cancel job`() {
//// viewModel.getCats()
// }
}
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ buildscript {
klint_version = "9.2.1"
compose_version = "1.5.3"
compose_compiler_version = "1.4.3"
mockk_version = "1.13.8"
testng_version = "7.3.0"
}
repositories {
google()
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
11 changes: 6 additions & 5 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

Expand Down Expand Up @@ -144,15 +141,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down
Loading