-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add java pipeline #5
Changes from 8 commits
0bcf642
d69eaa7
c6dd02a
7fbc2c8
5fed02f
535d68a
be9b84a
e7d2568
0a4427e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Java client benchmarks | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
name: | ||
required: false | ||
type: string | ||
|
||
run-name: ${{ inputs.name == '' && format('{0} @ {1}', github.ref_name, github.sha) || inputs.name }} | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
java: | ||
- 11 | ||
- 17 | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Set up JDK ${{ matrix.java }} | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "temurin" | ||
java-version: ${{ matrix.java }} | ||
|
||
# TODO: uncomment once benchmark implemented | ||
# - name: Run benchmarks | ||
# working-directory: java/jabushka | ||
# run: ./gradlew -Pbenchmark :benchmark:jedis :benchmark:lettuce :benchmark:jabushka | ||
|
||
- name: Upload test reports | ||
if: always() | ||
continue-on-error: true | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: test-reports-${{ matrix.java }} | ||
path: | | ||
java/jabushka/benchmarks/build/** |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: SQL Java CI | ||
|
||
on: | ||
pull_request: | ||
push: | ||
paths: | ||
- "java/**" | ||
- ".github/workflows/java.yml" | ||
|
||
# Run only most latest job on a branch and cancel previous ones | ||
concurrency: | ||
group: ${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
# Run all jobs | ||
fail-fast: false | ||
matrix: | ||
java: | ||
- 11 | ||
- 17 | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Set up JDK ${{ matrix.java }} | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "temurin" | ||
java-version: ${{ matrix.java }} | ||
|
||
- name: Install and run protoc (protobuf) | ||
run: | | ||
sudo apt update | ||
sudo apt install -y protobuf-compiler | ||
protoc -Iprotobuf=babushka-core/src/protobuf/ --java_out=java/jabushka/jabushka/src/main/java/org/babushka/jabushka/generated babushka-core/src/protobuf/*.proto | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you double-check the java_out folder? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
- name: Build rust part | ||
Yury-Fridlyand marked this conversation as resolved.
Show resolved
Hide resolved
|
||
working-directory: java | ||
run: cargo build | ||
|
||
- name: Build with Gradle | ||
working-directory: java/jabushka | ||
run: ./gradlew --continue build | ||
|
||
- name: Upload test reports | ||
if: always() | ||
continue-on-error: true | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: test-reports-${{ matrix.java }} | ||
path: | | ||
java/jabushka/jabushka/build/** | ||
java/jabushka/integTest/build/** |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,9 @@ | |
debug/ | ||
target/ | ||
|
||
# Git stuff | ||
.worktrees | ||
|
||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries | ||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html | ||
Cargo.lock | ||
|
@@ -17,6 +20,14 @@ dump.rdb | |
.env | ||
benchmarks/results | ||
|
||
# IDE generaged files | ||
.vs | ||
.vscode | ||
.idea | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These should be defined under individual's ~/gradle.properties. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why |
||
|
||
# MacOS metadata | ||
.DS_Store | ||
|
||
# lock files | ||
|
||
yarn.lock | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[env] | ||
acarbonetto marked this conversation as resolved.
Show resolved
Hide resolved
|
||
BABUSHKA_NAME = { value = "BabushkaPy", force = true } | ||
BABUSHKA_VERSION = "0.1.0" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.gradle | ||
*.iml | ||
.java-version | ||
build | ||
generated |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[package] | ||
acarbonetto marked this conversation as resolved.
Show resolved
Hide resolved
|
||
name = "jabushka" | ||
version = "0.0.0" | ||
edition = "2021" | ||
license = "BSD-3-Clause" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
[lib] | ||
name = "jabushka" | ||
crate-type = ["cdylib"] | ||
|
||
[dependencies] | ||
redis = { path = "../submodules/redis-rs/redis", features = ["aio", "tokio-comp", "connection-manager", "tls", "tokio-rustls-comp"] } | ||
babushka = { path = "../babushka-core" } | ||
tokio = { version = "^1", features = ["rt", "macros", "rt-multi-thread", "time"] } | ||
logger_core = {path = "../logger_core"} | ||
tracing-subscriber = "0.3.16" | ||
|
||
[profile.release] | ||
lto = true | ||
debug = true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
plugins { | ||
id 'java' | ||
id 'java-library' | ||
id 'io.freefair.lombok' version '6.4.0' | ||
id 'jacoco' | ||
id 'com.diffplug.spotless' version '6.19.0' | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenLocal() | ||
} | ||
|
||
subprojects { | ||
repositories { | ||
mavenCentral() | ||
mavenLocal() | ||
} | ||
// minimal java compatibility level | ||
plugins.withId('java') { | ||
sourceCompatibility = targetCompatibility = "11" | ||
} | ||
tasks.withType(Test) { | ||
useJUnitPlatform() | ||
|
||
testLogging { | ||
exceptionFormat "full" | ||
events "started", "skipped", "passed", "failed" | ||
showStandardStreams true | ||
} | ||
// Temporary suspend jacoco | ||
// finalizedBy jacocoTestReport, jacocoTestCoverageVerification | ||
} | ||
} | ||
|
||
dependencies { | ||
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: '5.6.2' | ||
} | ||
|
||
// Apply a specific Java toolchain to ease working on different environments. | ||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(17) | ||
} | ||
} | ||
|
||
// JaCoCo section (code coverage by unit tests) | ||
jacoco { | ||
toolVersion = "0.8.9" | ||
} | ||
jacocoTestReport { | ||
reports { | ||
xml.configure { enabled false } | ||
csv.configure { enabled false } | ||
} | ||
afterEvaluate { | ||
classDirectories.setFrom(files(classDirectories.files.collect { | ||
fileTree(dir: it) | ||
})) | ||
} | ||
} | ||
jacocoTestCoverageVerification { | ||
violationRules { | ||
rule { | ||
element = 'CLASS' | ||
excludes = [ | ||
] | ||
limit { | ||
counter = 'LINE' | ||
minimum = 1.0 | ||
acarbonetto marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
limit { | ||
counter = 'BRANCH' | ||
minimum = 1.0 | ||
} | ||
} | ||
} | ||
afterEvaluate { | ||
classDirectories.setFrom(files(classDirectories.files.collect { | ||
fileTree(dir: it) | ||
})) | ||
} | ||
} | ||
// Temporary suspend jacoco | ||
// check.dependsOn jacocoTestCoverageVerification | ||
// End of JaCoCo section | ||
|
||
// Spotless section (code style) | ||
spotless { | ||
java { | ||
target fileTree('.') { | ||
include '**/*.java' | ||
exclude '**/build/**', '**/build-*/**', '**/generated/**' | ||
} | ||
importOrder() | ||
removeUnusedImports() | ||
trimTrailingWhitespace() | ||
endWithNewline() | ||
googleJavaFormat('1.17.0').reflowLongStrings().groupArtifact('com.google.googlejavaformat:google-java-format') | ||
} | ||
} | ||
// End of Spotless section |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
version=1.13.0 | ||
org.gradle.jvmargs=-Duser.language=en -Duser.country=US |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be the
run
workflow (default name), should we rename it tobenchmark
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed in 0a4427e