diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..5497a70 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,45 @@ +name: Test Gradle project + +on: [push, pull_request] + +jobs: + + lint-gradle-project: + runs-on: ubuntu-latest + + steps: + - name: Checkout project source + uses: actions/checkout@v4 + + - name: Set Java + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: Run lint + run: ./gradlew lint + + build-gradle-project: + runs-on: ubuntu-latest + + needs: lint-gradle-project + + steps: + - name: Checkout project source + uses: actions/checkout@v4 + + - name: Set Java + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: 'temurin' + + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: Run build + run: ./gradlew build \ No newline at end of file diff --git a/build.gradle b/build.gradle index 0d803b7..5fde0a4 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,7 @@ plugins { id 'java' id 'org.springframework.boot' version '3.2.5' id("io.spring.dependency-management") version "1.0.11.RELEASE" + id "nebula.lint" version "17.8.0" } group = 'org.ghuh' @@ -16,23 +17,28 @@ repositories { } dependencies { - implementation("org.springframework.boot:spring-boot-starter-data-jpa") + implementation "org.springframework.boot:spring-boot-starter-data-jpa" implementation 'org.springframework.boot:spring-boot-starter-web' testImplementation 'org.springframework.boot:spring-boot-starter-test' - implementation("org.springframework.boot:spring-boot-starter-validation") - developmentOnly("org.springframework.boot:spring-boot-devtools") - annotationProcessor("org.springframework.boot:spring-boot-configuration-processor") - - compileOnly("org.projectlombok:lombok") - annotationProcessor("org.projectlombok:lombok") - compileOnly("org.projectlombok:lombok") - annotationProcessor("org.projectlombok:lombok") - - runtimeOnly("com.h2database:h2") - testImplementation("org.springframework.boot:spring-boot-starter-test") - implementation("io.swagger.core.v3:swagger-annotations:2.1.12") + implementation "org.springframework.boot:spring-boot-starter-validation" + developmentOnly "org.springframework.boot:spring-boot-devtools" + annotationProcessor "org.springframework.boot:spring-boot-configuration-processor" + + annotationProcessor "org.projectlombok:lombok" + annotationProcessor "org.projectlombok:lombok" + + runtimeOnly "com.h2database:h2" + testImplementation "org.springframework.boot:spring-boot-starter-test" + implementation 'org.springframework.boot:spring-boot-autoconfigure:3.2.5' + implementation 'org.springframework.boot:spring-boot:3.2.5' + implementation 'org.springframework:spring-context:6.1.6' + implementation 'org.springframework:spring-web:6.1.6' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' + testImplementation 'org.springframework.boot:spring-boot-test:3.2.5' } tasks.named('test') { useJUnitPlatform() } + +gradleLint.rules = ['dependency-parentheses', 'dependency-tuple'] diff --git a/lint.gradle b/lint.gradle deleted file mode 100644 index e69de29..0000000 diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 5e355eb..291b7fc 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1 +1,7 @@ spring.application.name=ctcd + +CITY_API_ADDR=127.0.0.1 +CITY_API_PORT=2022 +CITY_API_DB_URL="" +CITY_API_DB_USER="" +CITY_API_DB_PWD=""