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
14 changes: 14 additions & 0 deletions .github/workflows/assigner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: 👌Auto assigner

on:
pull_request:
types:
- opened

jobs:
assign:
runs-on: ubuntu-latest
steps:
- uses: hkusu/review-assign-action@v1
with:
assignees: ${{ github.actor }}
50 changes: 50 additions & 0 deletions .github/workflows/tester.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: ✅ Tester
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'

jobs:
build:
name: sonarcloud report
runs-on: ubuntu-latest
strategy:
matrix:
kotlin-version: [ 1.9.22 ]
java-version: [ 17 ]
steps:
- name: checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true

- name: Set up JDK 17 and Kotlin 1.9.22
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.java-version }}
kotlin-version: ${{ matrix.kotlin-version }}

- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Build and analyze
run: ./gradlew clean test sonar --info
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
75 changes: 75 additions & 0 deletions .github/workflows/type-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: 🕶️ Type labeler

on:
pull_request:
issues:

jobs:
add_label:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: checkout
uses: actions/checkout@v3

- name: add ✨ feature label
uses: actions-ecosystem/action-add-labels@v1
if: ${{ startsWith(github.event.issues.title, 'feat:') || startsWith(github.event.pull_request.title, 'feat:') }}
with:
labels: ✨ feature

- name: add 🐛 bug-fix label
uses: actions-ecosystem/action-add-labels@v1
if: ${{ startsWith(github.event.issues.title, 'fix:') || startsWith(github.event.pull_request.title, 'fix:') }}
with:
labels: 🐛 bug-fix

- name: add ♻️ refactor label
uses: actions-ecosystem/action-add-labels@v1
if: ${{ startsWith(github.event.issues.title, 'refactor:') || startsWith(github.event.pull_request.title, 'refactor:') }}
with:
labels: ♻️ refactor

- name: add 🎨 style label
uses: actions-ecosystem/action-add-labels@v1
if: ${{ startsWith(github.event.issues.title, 'style:') || startsWith(github.event.pull_request.title, 'style:') }}
with:
labels: 🎨 style

- name: add 🏠 build label
uses: actions-ecosystem/action-add-labels@v1
if: ${{ startsWith(github.event.issues.title, 'build:') || startsWith(github.event.pull_request.title, 'chore:') }}
with:
labels: 🏠 build

- name: add ✅ test label
uses: actions-ecosystem/action-add-labels@v1
if: ${{ startsWith(github.event.issues.title, 'test:') || startsWith(github.event.pull_request.title, 'test:') }}
with:
labels: ✅ test

- name: add 📝 docs label
uses: actions-ecosystem/action-add-labels@v1
if: ${{ startsWith(github.event.issues.title, 'docs:') || startsWith(github.event.pull_request.title, 'docs:') }}
with:
labels: 📝 docs

- name: add 📝 ci label
uses: actions-ecosystem/action-add-labels@v1
if: ${{ startsWith(github.event.issues.title, 'ci:') || startsWith(github.event.pull_request.title, 'ci:') }}
with:
labels: 📝 ci

- name: add 💪 perf label
uses: actions-ecosystem/action-add-labels@v1
if: ${{ startsWith(github.event.issues.title, 'perf:') || startsWith(github.event.pull_request.title, 'perf:') }}
with:
labels: 💪 perf

- name: add 🔖 release label
uses: actions-ecosystem/action-add-labels@v1
if: ${{ startsWith(github.event.pull_request.title, 'release:') }}
with:
labels: 🔖 release
44 changes: 44 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store

.idea/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "idl"]
path = idl
url = https://github.com/rooftop-MSA/Netx-IDL.git
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# netx
👾 Choreography-based distributed transaction library
# Netx <img src="https://avatars.githubusercontent.com/u/149151221?s=200&v=4" height = 100 align = left>

> Distributed transaction library based on Choreography
24 changes: 24 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
plugins {
id "application"
id "org.jetbrains.kotlin.jvm" version "${jetbrainKotlinVersion}"
id "org.jetbrains.kotlin.plugin.spring" version "${jetbrainKotlinVersion}"
id "org.springframework.boot" version "${springbootVersion}"
id "io.spring.dependency-management" version "${springDependencyManagementVersion}"
id "org.sonarqube" version "${sonarcloudVersion}"
id "com.google.protobuf" version "${protobufPluginVersion}"
}

group = "${group}"
version = "${version}"

repositories {
mavenCentral()
}

apply from: "gradle/mq.gradle"
apply from: "gradle/test.gradle"
apply from: "gradle/core.gradle"
apply from: "gradle/sonar.gradle"
apply from: "gradle/kotlin.gradle"
apply from: "gradle/spring.gradle"
apply from: "gradle/protobuf.gradle"
37 changes: 37 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
kotlin.code.style=official

### Project ###
group=org.rooftop.netx
version=0.1.0

### Protobuf ###
protobufPluginVersion=0.9.4
protobufVersion=3.25.0

### Sonarcloud ###
sonarcloudVersion=4.4.1.3373
sonarProjectKey=rooftop-MSA_pay-server
sonarOrganization=rooftop-msa
sonarHostUrl=https://sonarcloud.io

### Spring ###
springDependencyManagementVersion=1.1.1
springbootVersion=3.1.1
springMockkVersion=4.0.0

### Kotlin ###
jetbrainKotlinVersion=1.9.22
jvmTarget=17

### Kotest ###
kotestVersion=5.7.2
kotestExtensionSpringVersion=1.1.3

### Snowflake ###
snowflakeVersion=5.2.5

### Lettuce ###
lettuceVersion=6.3.0.RELEASE

### TestContainer ###
testContainerVersion=1.19.3
3 changes: 3 additions & 0 deletions gradle/core.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependencies {
implementation "com.github.f4b6a3:tsid-creator:${snowflakeVersion}"
}
13 changes: 13 additions & 0 deletions gradle/kotlin.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
compileKotlin {
kotlinOptions.jvmTarget = "${jvmTarget}"
}

compileTestKotlin {
kotlinOptions.jvmTarget = "${jvmTarget}"
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-reflect"

testImplementation "org.jetbrains.kotlin:kotlin-test"
}
3 changes: 3 additions & 0 deletions gradle/mq.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependencies {
implementation "io.lettuce:lettuce-core:${lettuceVersion}"
}
17 changes: 17 additions & 0 deletions gradle/protobuf.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:${protobufVersion}"
}
generateProtoTasks {
all().forEach {
it.builtins { kotlin {} }
}
}
}

dependencies {
implementation "com.google.protobuf:protobuf-kotlin:${protobufVersion}"
implementation "com.google.protobuf:protobuf-java:${protobufVersion}"

protobuf files("./idl/")
}
7 changes: 7 additions & 0 deletions gradle/sonar.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sonar {
properties {
property "sonar.projectKey", "${sonarProjectKey}"
property "sonar.organization", "${sonarOrganization}"
property "sonar.host.url", "${sonarHostUrl}"
}
}
12 changes: 12 additions & 0 deletions gradle/spring.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
jar {
enabled = false
}

dependencies {
implementation "org.springframework.boot:spring-boot-starter"
implementation "org.springframework.boot:spring-boot-starter-data-redis-reactive"

testImplementation "org.springframework.boot:spring-boot-starter-test"

testImplementation "com.ninja-squad:springmockk:${springMockkVersion}"
}
13 changes: 13 additions & 0 deletions gradle/test.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
test {
useJUnitPlatform()
}

dependencies {
testImplementation "io.projectreactor:reactor-test"

testImplementation "io.kotest:kotest-runner-junit5:${kotestVersion}"
testImplementation "io.kotest:kotest-assertions-core:${kotestVersion}"
testImplementation "io.kotest.extensions:kotest-extensions-spring:${kotestExtensionSpringVersion}"

testImplementation "org.testcontainers:testcontainers:${testContainerVersion}"
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading