Skip to content

Commit

Permalink
Merge pull request #5 from averak/feature/3_setup_github_actions
Browse files Browse the repository at this point in the history
GitHub Actionsを導入
  • Loading branch information
averak authored Sep 29, 2023
2 parents 0ea2867 + ed72153 commit bcc1f13
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 16 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: CI

on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: corretto
java-version: 17
cache: gradle

- name: backend test
run: |
./gradlew test -x build
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: corretto
java-version: 17
cache: gradle

- name: backend lint
run: |
./gradlew spotlessCheck
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: corretto
java-version: 17
cache: gradle

- name: backend build
run: |
./gradlew build
39 changes: 28 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# gsync

![CI](https://github.com/averak/gsync/workflows/CI/badge.svg)
![version](https://img.shields.io/badge/version-1.0.0--SNAPSHOT-blue.svg)

This is a multi-tenancy game server for MO games.
Expand All @@ -23,39 +24,55 @@ This component provides only reusable features that can be used across various g
* Quarkus 3.4
* TiDB 7.1

## Running the application in dev mode
### Running the application in dev mode

You can run your application in dev mode that enables live coding using:
You can run your application in dev mode that enables live coding.

```shell script
```shell
docker compose up -d
./gradlew quarkusDev
```

> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/.
## Packaging and running the application
### Packaging and running the application

The application can be packaged using:
The application can be packaged.

```shell script
```shell
./gradlew build
```

It produces the `quarkus-run.jar` file in the `build/quarkus-app/` directory.

The application is now runnable using `java -jar build/quarkus-app/quarkus-run.jar`.

## Creating a native executable
### Creating a native executable

You can create a native executable using:
You can create a native executable.

```shell script
```shell
./gradlew build -Dquarkus.package.type=native
```

Or, if you don't have GraalVM installed, you can run the native executable build in a container using:
Or, if you don't have GraalVM installed, you can run the native executable build in a container.

```shell script
```shell
./gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-build=true
```

### Check Dependency updates

[Gradle Versions Plugin](https://github.com/ben-manes/gradle-versions-plugin) checks outdated dependencies.

```shell
$ ./gradlew dependencyUpdates -Drevision=release
```

### Run code formatter

This codebase is formatted by [ktlint](https://github.com/pinterest/ktlint).

```shell
./gradlew spotlessApply
```
12 changes: 11 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {

id("io.quarkus")
id("com.github.ben-manes.versions") version "0.47.0"
id("com.diffplug.spotless") version "6.21.0"

application
java
Expand Down Expand Up @@ -69,4 +70,13 @@ allOpen {
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = JavaVersion.VERSION_17.toString()
kotlinOptions.javaParameters = true
}
}

spotless {
kotlin {
ktlint()
trimTrailingWhitespace()
indentWithSpaces()
endWithNewline()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ class HealthCheckController {
fun health(): RestResponse<Void> {
return RestResponse.ok()
}

}
4 changes: 1 addition & 3 deletions src/test/kotlin/net/averak/gsync/testutils/JsonUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,5 @@ class JsonUtils {
fun <T> fromJson(json: String, clazz: Class<T>): T {
return objectMapper.readValue(json, clazz)
}

}

}
}

0 comments on commit bcc1f13

Please sign in to comment.