Skip to content

Commit

Permalink
Setup
Browse files Browse the repository at this point in the history
  • Loading branch information
GoodforGod committed Sep 23, 2024
1 parent 672e640 commit 3a0921f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 7 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/test-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: "21"
java-version: "17"
distribution: "adopt"

- name: Build classes
run: "./gradlew classes"
run: |
./gradlew classes || true
./gradlew classes
- name: Build tests
run: "./gradlew testClasses"
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: "21"
java-version: "17"
distribution: "adopt"

- name: Build classes
run: "./gradlew classes"
run: |
./gradlew classes || true
./gradlew classes
- name: Build tests
run: "./gradlew testClasses"
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[![GitHub Action](https://github.com/kora-projects/kora-java-crud-template/workflows/Build%20Master/badge.svg)](https://github.com/kora-projects/kora-java-crud-template/actions?query=workflow%3A%22Build%20Master%22++)
[![GitHub Action](https://github.com/kora-projects/kora-kotlin-crud-template/workflows/Build%20Master/badge.svg)](https://github.com/kora-projects/kora-kotlin-crud-template/actions?query=workflow%3A%22Build%20Master%22++)

# Шаблон приложения Kora Java CRUD
# Шаблон приложения Kora Kotlin CRUD

Пример сервиса реализованного на Kora с HTTP [CRUD](https://github.com/swagger-api/swagger-petstore) API,
Пример Kotlin сервиса реализованного на Kora с HTTP [CRUD](https://github.com/swagger-api/swagger-petstore) API,
в качестве базы данных выступает Postgres, используется кэш Caffeine, а также другие модули которые использовались бы в реальном приложении в бою.

В примере использовались модули:
Expand All @@ -18,6 +18,12 @@

## Build

Собрать классы (может потребоваться запустить 2 раза из-за APT):

```shell
./gradlew classes
```

Собрать артефакт:

```shell
Expand Down
16 changes: 16 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ buildscript {
plugins {
id("org.openapi.generator") version ("7.4.0")
id("application")
id("jacoco")
kotlin("kapt") version ("1.9.10")
kotlin("jvm") version ("1.9.10")
id("org.flywaydb.flyway") version ("8.4.2")
id("com.google.devtools.ksp") version ("1.9.10-1.0.13")
}

Expand Down Expand Up @@ -116,6 +118,13 @@ tasks.withType<JavaExec> {
)
}

flyway {
url = "jdbc:postgresql://$postgresHost:$postgresPort/$postgresDatabase"
user = postgresUser
password = postgresPassword
locations = arrayOf("classpath:db/migration")
}

tasks.distTar {
archiveFileName.set("application.tar")
}
Expand All @@ -131,3 +140,10 @@ tasks.test {
junitXml.required = false
}
}

tasks.jacocoTestReport {
reports {
xml.required = true
html.outputLocation = layout.buildDirectory.dir("jacocoHtml")
}
}

0 comments on commit 3a0921f

Please sign in to comment.