This is an automated email from the ASF dual-hosted git repository.
suiliangliang pushed a commit to branch releases-0.10
in repository https://gitbox.apache.org/repos/asf/fury.git
The following commit(s) were added to refs/heads/releases-0.10 by this push:
new fb24fcc8 feat(kotlin): add kotlin ci (#2176) (#2189)
fb24fcc8 is described below
commit fb24fcc81b05c2b9c13811135fd41920c3b23abe
Author: LiangliangSui <[email protected]>
AuthorDate: Fri Apr 25 00:30:22 2025 +0800
feat(kotlin): add kotlin ci (#2176) (#2189)
<!--
**Thanks for contributing to Fury.**
**If this is your first time opening a PR on fury, you can refer to
[CONTRIBUTING.md](https://github.com/apache/fury/blob/main/CONTRIBUTING.md).**
Contribution Checklist
- The **Apache Fury (incubating)** community has restrictions on the
naming of pr titles. You can also find instructions in
[CONTRIBUTING.md](https://github.com/apache/fury/blob/main/CONTRIBUTING.md).
- Fury has a strong focus on performance. If the PR you submit will have
an impact on performance, please benchmark it first and provide the
benchmark result here.
-->
## What does this PR do?
cp https://github.com/apache/fury/pull/2176
<!-- Describe the purpose of this PR. -->
## Related issues
<!--
Is there any related issue? Please attach here.
- #xxxx0
- #xxxx1
- #xxxx2 -->
## Does this PR introduce any user-facing change?
<!--
If any user-facing interface changes, please [open an
issue](https://github.com/apache/fury/issues/new/choose) describing the
need to do so and update the document if necessary. -->
- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?
## Benchmark
<!--
When the PR has an impact on performance (if you don't know whether the
PR will have an impact on performance, you can submit the PR first, and
if it will have impact on performance, the code reviewer will explain
it), be sure to attach a benchmark data here.
-->
<!--
**Thanks for contributing to Fury.**
**If this is your first time opening a PR on fury, you can refer to
[CONTRIBUTING.md](https://github.com/apache/fury/blob/main/CONTRIBUTING.md).**
Contribution Checklist
- The **Apache Fury (incubating)** community has restrictions on the
naming of pr titles. You can also find instructions in
[CONTRIBUTING.md](https://github.com/apache/fury/blob/main/CONTRIBUTING.md).
- Fury has a strong focus on performance. If the PR you submit will have
an impact on performance, please benchmark it first and provide the
benchmark result here.
-->
## What does this PR do?
<!-- Describe the purpose of this PR. -->
## Related issues
<!--
Is there any related issue? Please attach here.
- #xxxx0
- #xxxx1
- #xxxx2
-->
## Does this PR introduce any user-facing change?
<!--
If any user-facing interface changes, please [open an
issue](https://github.com/apache/fury/issues/new/choose) describing the
need to do so and update the document if necessary.
-->
- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?
## Benchmark
<!--
When the PR has an impact on performance (if you don't know whether the
PR will have an impact on performance, you can submit the PR first, and
if it will have impact on performance, the code reviewer will explain
it), be sure to attach a benchmark data here.
-->
---------
Co-authored-by: PAN <[email protected]>
---
.github/workflows/ci.yml | 20 ++++++++++++++++++++
ci/run_ci.sh | 15 +++++++++++++++
.../serializer/kotlin/UnsignedArraySerializers.kt | 5 +++++
.../fury/serializer/kotlin/UnsignedSerializer.kt | 5 +++++
4 files changed, 45 insertions(+)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 75d9e851..da6b5db9 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -136,6 +136,26 @@ jobs:
shell: bash
run: ./ci/run_ci.sh graalvm_test
+ kotlin:
+ name: Kotlin CI
+ runs-on: ubuntu-latest
+ env:
+ MY_VAR: "PATH"
+ strategy:
+ matrix:
+ java-version: ["8", "11", "17", "21"]
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up JDK ${{ matrix.java-version }}
+ uses: actions/setup-java@v4
+ with:
+ java-version: ${{ matrix.java-version }}
+ distribution: "temurin"
+ - name: Install fury java
+ run: cd java && mvn -T10 --no-transfer-progress clean install
-DskipTests && cd -
+ - name: Run Kotlin CI
+ run: ./ci/run_ci.sh kotlin
+
scala:
name: Scala CI
runs-on: ubuntu-latest
diff --git a/ci/run_ci.sh b/ci/run_ci.sh
index adf62a6c..c5d4c565 100755
--- a/ci/run_ci.sh
+++ b/ci/run_ci.sh
@@ -156,6 +156,18 @@ jdk17_plus_tests() {
echo "Executing latest_jdk_tests succeeds"
}
+kotlin_tests() {
+ echo "Executing fury kotlin tests"
+ cd "$ROOT/kotlin"
+ set +e
+ mvn -T16 --batch-mode --no-transfer-progress test -DfailIfNoTests=false
+ testcode=$?
+ if [[ $testcode -ne 0 ]]; then
+ exit $testcode
+ fi
+ echo "Executing fury kotlin tests succeeds"
+}
+
windows_java21_test() {
java -version
echo "Executing fury java tests"
@@ -199,6 +211,9 @@ case $1 in
java21)
jdk17_plus_tests
;;
+ kotlin)
+ kotlin_tests
+ ;;
windows_java21)
windows_java21_test
;;
diff --git
a/kotlin/src/main/kotlin/org/apache/fury/serializer/kotlin/UnsignedArraySerializers.kt
b/kotlin/src/main/kotlin/org/apache/fury/serializer/kotlin/UnsignedArraySerializers.kt
index 374d0eea..5a4e55a4 100644
---
a/kotlin/src/main/kotlin/org/apache/fury/serializer/kotlin/UnsignedArraySerializers.kt
+++
b/kotlin/src/main/kotlin/org/apache/fury/serializer/kotlin/UnsignedArraySerializers.kt
@@ -24,6 +24,7 @@ package org.apache.fury.serializer.kotlin
import org.apache.fury.Fury
import org.apache.fury.memory.MemoryBuffer
import org.apache.fury.serializer.Serializer
+import org.apache.fury.type.Type
public abstract class AbstractDelegatingArraySerializer<T, T_Delegate>(
fury: Fury,
@@ -38,6 +39,10 @@ public abstract class AbstractDelegatingArraySerializer<T,
T_Delegate>(
protected abstract fun fromDelegateClass(value: T_Delegate): T
+ override fun getXtypeId(): Short {
+ return (-Type.LIST.id).toShort()
+ }
+
override fun xwrite(buffer: MemoryBuffer, value: T) {
write(buffer, value)
}
diff --git
a/kotlin/src/main/kotlin/org/apache/fury/serializer/kotlin/UnsignedSerializer.kt
b/kotlin/src/main/kotlin/org/apache/fury/serializer/kotlin/UnsignedSerializer.kt
index e2492c2a..2e0df5c2 100644
---
a/kotlin/src/main/kotlin/org/apache/fury/serializer/kotlin/UnsignedSerializer.kt
+++
b/kotlin/src/main/kotlin/org/apache/fury/serializer/kotlin/UnsignedSerializer.kt
@@ -22,6 +22,7 @@ package org.apache.fury.serializer.kotlin
import org.apache.fury.Fury
import org.apache.fury.memory.MemoryBuffer
import org.apache.fury.serializer.Serializers
+import org.apache.fury.type.Type
/**
* UByteSerializer
@@ -34,6 +35,7 @@ public class UByteSerializer(
Serializers.CrossLanguageCompatibleSerializer<UByte>(
fury,
UByte::class.java,
+ Type.UINT8.id,
fury.isBasicTypesRefIgnored,
true
) {
@@ -58,6 +60,7 @@ public class UShortSerializer(
Serializers.CrossLanguageCompatibleSerializer<UShort>(
fury,
UShort::class.java,
+ Type.UINT16.id,
fury.isBasicTypesRefIgnored,
true
) {
@@ -81,6 +84,7 @@ public class UIntSerializer(
Serializers.CrossLanguageCompatibleSerializer<UInt>(
fury,
UInt::class.java,
+ Type.UINT32.id,
fury.isBasicTypesRefIgnored,
true
) {
@@ -105,6 +109,7 @@ public class ULongSerializer(
Serializers.CrossLanguageCompatibleSerializer<ULong>(
fury,
ULong::class.java,
+ Type.UINT64.id,
fury.isBasicTypesRefIgnored,
true
) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]