Skip to content

Commit 80dc50e

Browse files
committed
chore: update
1 parent d3cb833 commit 80dc50e

File tree

4 files changed

+54
-0
lines changed

4 files changed

+54
-0
lines changed

.github/workflows/build.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v2
18+
19+
- name: Set up JDK 21
20+
uses: actions/setup-java@v2
21+
with:
22+
distribution: 'microsoft'
23+
java-version: '21'
24+
25+
- name: Cache Maven packages
26+
uses: actions/cache@v2
27+
with:
28+
path: ~/.m2/repository
29+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
30+
restore-keys: |
31+
${{ runner.os }}-maven-
32+
33+
- name: Build with Maven
34+
run: mvn clean install
35+
36+
- name: Run tests
37+
run: mvn test

src/main/kotlin/nl/tomh/hello/HelloController.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,9 @@ class HelloController {
99
fun hello(): String {
1010
return "Hello, world!"
1111
}
12+
13+
@QueryMapping
14+
fun prime(): Tokemon {
15+
return Tokemon("Prime", "Fire", "A fiery Tokemon.")
16+
}
1217
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package nl.tomh.hello
2+
3+
data class Tokemon(val name: String, val type: String, val description: String) {
4+
fun sayHello() = "Hello, my name is $name and I am a $type Tokemon. $description"
5+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
type Query {
22
hello: String
3+
prime: Tokemon
4+
}
5+
6+
type Tokemon {
7+
name: String
8+
description: String
9+
type: String
310
}

0 commit comments

Comments
 (0)