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
26 changes: 26 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: E2E Tests

on:
workflow_dispatch: # Manual trigger only (FR-009)

jobs:
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'jetbrains'
java-version: '21'

# FR-010: Publish worldtides to mavenLocal first
- name: Publish worldtides to mavenLocal
run: ./gradlew :worldtides:publishToMavenLocal

# Run sample-client tests with API key
- name: Run E2E Tests
env:
WORLD_TIDES_API_KEY: ${{ secrets.WORLD_TIDES_API_KEY }}
run: |
cd sample-client
./gradlew test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,6 @@ local.properties

# Agent
.agent

# VSCode
.vscode
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Declare the dependency in the module's `build.gradle`:

```gradle
dependencies {
implementation 'com.oleksandrkruk:worldtides:1.0.0'
implementation 'com.oleksandrkruk:worldtides:2.0.0'
}
```

Expand Down
62 changes: 62 additions & 0 deletions sample-client/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
plugins {
kotlin("jvm") version "1.9.20"
application
}

repositories {
mavenLocal() // Consume worldtides from local publish
mavenCentral()
}

dependencies {
implementation("com.oleksandrkruk:worldtides:+") // Latest from mavenLocal

testImplementation(kotlin("test"))
testImplementation("org.assertj:assertj-core:3.12.2")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.6.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.6.2")
}

application {
mainClass.set("com.oleksandrkruk.worldtides.sample.SampleClientKt")
}

tasks.test {
useJUnitPlatform()
// Pass environment variable to tests
environment("WORLD_TIDES_API_KEY", System.getenv("WORLD_TIDES_API_KEY") ?: "")

testLogging {
events("passed", "skipped", "failed")
showStandardStreams = true
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
showCauses = true
showStackTraces = true
}

// Show test duration
afterSuite(KotlinClosure2<TestDescriptor, TestResult, Unit>({ desc, result ->
if (desc.parent == null) {
println("\nTest Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)")
println("Duration: ${result.endTime - result.startTime}ms")
}
}))
}

tasks.compileKotlin {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}

tasks.compileTestKotlin {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

6 changes: 6 additions & 0 deletions sample-client/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Sun Jan 12 21:38:08 GMT 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
234 changes: 234 additions & 0 deletions sample-client/gradlew

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

Loading