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
19 changes: 3 additions & 16 deletions .github/workflows/publish-java-sdks.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
# Copyright 2025 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Publish Java SDKs

on:
Expand All @@ -26,7 +12,6 @@ permissions:
jobs:
publish:
name: Publish (${{ matrix.sdk.name }})
if: startsWith(github.ref, format('refs/tags/java/{0}/v', matrix.sdk.tagPrefix))
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -38,6 +23,7 @@ jobs:
- name: code-interpreter
tagPrefix: code-interpreter
workingDirectory: sdks/code-interpreter/kotlin

steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -53,10 +39,11 @@ jobs:

- name: Publish to Maven Central
working-directory: ${{ matrix.sdk.workingDirectory }}
if: startsWith(github.ref, format('refs/tags/java/{0}/v', matrix.sdk.tagPrefix))
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }}
run: |
./gradlew publishToMavenCentral
./gradlew publishToMavenCentral
61 changes: 59 additions & 2 deletions .github/workflows/real-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ on:
branches: [ main ]

jobs:
docker-bridge:
python-e2e:
name: Python E2E (docker bridge)
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down Expand Up @@ -51,5 +52,61 @@ jobs:

- name: Eval logs
if: ${{ always() }}
run: cat server/server.log

java-e2e:
name: Java E2E (docker bridge)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
cache: gradle

- name: Install uv
run: pip install uv

- name: Run tests
env:
TAG: latest
GRADLE_USER_HOME: ${{ github.workspace }}/.gradle-user-home
run: |
cat server/server.log
set -e

# Create config file
cat <<EOF > ~/.sandbox.toml
[server]
host = "127.0.0.1"
port = 8080
log_level = "INFO"
api_key = ""
[runtime]
type = "docker"
execd_image = "opensandbox/execd:${TAG}"
[docker]
network_mode = "bridge"
EOF

bash ./scripts/java-e2e.sh

- name: Eval logs
if: ${{ always() }}
run: cat server/server.log

- name: Upload Test Report
if: always()
uses: actions/upload-artifact@v4
with:
name: java-test-report
path: tests/java/build/reports/tests/test/
retention-days: 5
43 changes: 43 additions & 0 deletions scripts/java-e2e.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash
# Copyright 2025 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -euxo pipefail

# prepare required images
TAG=${TAG:-latest}
docker pull opensandbox/execd:${TAG}
docker pull opensandbox/code-interpreter:${TAG}

# setup server
cd server
uv sync && uv run python -m src.main > server.log 2>&1 &
cd ..

# wait for server
sleep 10

cd sdks/sandbox/kotlin
./gradlew publishToMavenLocal
cd ../../../

cd sdks/code-interpreter/kotlin
./gradlew publishToMavenLocal -PuseMavenLocal
cd ../../../

# run Java e2e
cd tests/java
./gradlew test


4 changes: 3 additions & 1 deletion sdks/code-interpreter/kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ subprojects {
configure<com.vanniktech.maven.publish.MavenPublishBaseExtension> {
coordinates(project.group.toString(), project.name, project.version.toString())
publishToMavenCentral()
signAllPublications()
if (!gradle.startParameter.taskNames.any { it.contains("publishToMavenLocal") }) {
signAllPublications()
}
pom {
name.set(project.name)
description.set("Alibaba Code Interpreter SDK")
Expand Down
4 changes: 3 additions & 1 deletion sdks/sandbox/kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ subprojects {
configure<com.vanniktech.maven.publish.MavenPublishBaseExtension> {
coordinates(project.group.toString(), project.name, project.version.toString())
publishToMavenCentral()
signAllPublications()
if (!gradle.startParameter.taskNames.any { it.contains("publishToMavenLocal") }) {
signAllPublications()
}
pom {
name.set(project.name)
description.set("Alibaba Open Sandbox SDK")
Expand Down
Loading
Loading