Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
36 changes: 36 additions & 0 deletions .github/workflows/ci-kotlin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: sqlc kotlin test suite
on: [push, pull_request]
jobs:

build:
name: Build And Test
runs-on: ubuntu-latest

services:
postgres:
image: postgres:11
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@master
- uses: actions/setup-java@v1
with:
java-version: 11
- uses: eskatos/gradle-command-action@v1
env:
PG_USER: postgres
PG_HOST: localhost
PG_DATABASE: postgres
PG_PASSWORD: postgres
PG_PORT: ${{ job.services.postgres.ports['5432'] }}
with:
build-root-directory: examples/kotlin
wrapper-directory: examples/kotlin
arguments: test --scan
4 changes: 4 additions & 0 deletions examples/kotlin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.gradle/
/.idea/
/build/
/out/
17 changes: 17 additions & 0 deletions examples/kotlin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Kotlin examples

This is a Kotlin gradle project configured to compile and test all examples. Currently tests have only been written for the `authors` example.

To run tests:

```shell script
./gradlew clean test
```

The project can be easily imported into Intellij.

1. Install Java if you don't already have it
1. Download Intellij IDEA Community Edition
1. In the "Welcome" modal, click "Import Project"
1. Open the `build.gradle` file adjacent to this README file
1. Wait for Intellij to sync the gradle modules and complete indexing
33 changes: 33 additions & 0 deletions examples/kotlin/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.3.60'
}

group 'com.example'
version '1.0-SNAPSHOT'

repositories {
mavenCentral()
}

dependencies {
implementation 'org.postgresql:postgresql:42.2.9'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
}

test {
useJUnitPlatform()
}

compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}

buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}
1 change: 1 addition & 0 deletions examples/kotlin/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kotlin.code.style=official
Binary file added examples/kotlin/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions examples/kotlin/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Sat Jan 25 10:45:34 EST 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
172 changes: 172 additions & 0 deletions examples/kotlin/gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 84 additions & 0 deletions examples/kotlin/gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions examples/kotlin/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
plugins {
id("com.gradle.enterprise").version("3.1.1")
}

rootProject.name = 'dbtest'
Loading