Skip to content
Open
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
326 changes: 169 additions & 157 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,181 +13,193 @@ jobs:
runs-on: ubuntu-latest-16-cores
timeout-minutes: 30
steps:
- name: Checkout repo
uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: recursive
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Java
uses: actions/setup-java@v5
with:
java-version: "23"
distribution: "temurin"

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v5

- name: Run unit tests
env:
USER: unittest
USE_DOCKER_SERVICE: false
run: ./gradlew --no-daemon test -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest

- name: Run independent resource tuner test
env:
USER: unittest
USE_DOCKER_SERVICE: false
run: ./gradlew --no-daemon temporal-sdk:testResourceIndependent -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest

- name: Publish Test Report
uses: mikepenz/action-junit-report@v6
if: success() || failure() # always run even if the previous step fails
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
- name: Checkout repo
uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: recursive
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Java
uses: actions/setup-java@v5
with:
java-version: "23"
distribution: "temurin"

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v5

- name: Run unit tests
env:
USER: unittest
USE_DOCKER_SERVICE: false
run: ./gradlew --no-daemon test -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest

- name: Run independent resource tuner test
env:
USER: unittest
USE_DOCKER_SERVICE: false
run: ./gradlew --no-daemon temporal-sdk:testResourceIndependent -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest

- name: Run Spring Boot 3 compatibility tests
env:
USER: unittest
USE_DOCKER_SERVICE: false
run: ./gradlew --no-daemon :temporal-spring-boot-autoconfigure:test -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest -P springBoot3Test

- name: Run Spring Boot 4 compatibility tests
env:
USER: unittest
USE_DOCKER_SERVICE: false
run: ./gradlew --no-daemon :temporal-spring-boot-autoconfigure:test -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest -P springBoot4Test

- name: Publish Test Report
uses: mikepenz/action-junit-report@v6
if: success() || failure() # always run even if the previous step fails
with:
report_paths: "**/build/test-results/test/TEST-*.xml"

unit_test_jdk8:
name: Unit test with docker service [JDK8]
runs-on: ubuntu-latest-16-cores
timeout-minutes: 30
steps:
- name: Checkout repo
uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: recursive
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Java
uses: actions/setup-java@v5
with:
java-version: |
23
11
distribution: "temurin"

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v5

- name: Start containerized server and dependencies
env:
TEMPORAL_CLI_VERSION: 1.6.1-server-1.31.0-151.0
run: |
wget -O temporal_cli.tar.gz https://github.com/temporalio/cli/releases/download/v${TEMPORAL_CLI_VERSION}/temporal_cli_${TEMPORAL_CLI_VERSION}_linux_amd64.tar.gz
tar -xzf temporal_cli.tar.gz
chmod +x temporal
./temporal server start-dev \
--headless \
--port 7233 \
--http-port 7243 \
--namespace UnitTest \
--db-filename temporal.sqlite \
--sqlite-pragma journal_mode=WAL \
--sqlite-pragma synchronous=OFF \
--search-attribute CustomKeywordField=Keyword \
--search-attribute CustomStringField=Text \
--search-attribute CustomTextField=Text \
--search-attribute CustomIntField=Int \
--search-attribute CustomDatetimeField=Datetime \
--search-attribute CustomDoubleField=Double \
--search-attribute CustomBoolField=Bool \
--dynamic-config-value system.enableActivityEagerExecution=true \
--dynamic-config-value history.MaxBufferedQueryCount=10000 \
--dynamic-config-value frontend.workerVersioningDataAPIs=true \
--dynamic-config-value history.enableRequestIdRefLinks=true \
--dynamic-config-value 'component.callbacks.allowedAddresses=[{"Pattern":"localhost:7243","AllowInsecure":true}]' &
sleep 10s

- name: Run unit tests
env:
USER: unittest
TEMPORAL_SERVICE_ADDRESS: localhost:7233
USE_DOCKER_SERVICE: true
run: ./gradlew --no-daemon test -x spotlessCheck -x spotlessApply -x spotlessJava

- name: Run Jackson 3 converter tests
env:
USER: unittest
USE_DOCKER_SERVICE: false
run: ./gradlew --no-daemon :temporal-sdk:jackson3Tests -x spotlessCheck -x spotlessApply -x spotlessJava

- name: Run virtual thread tests
env:
USER: unittest
TEMPORAL_SERVICE_ADDRESS: localhost:7233
USE_DOCKER_SERVICE: true
run: ./gradlew --no-daemon :temporal-sdk:virtualThreadTests -x spotlessCheck -x spotlessApply -x spotlessJava

- name: Publish Test Report
uses: mikepenz/action-junit-report@v6
if: success() || failure() # always run even if the previous step fails
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
- name: Checkout repo
uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: recursive
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Java
uses: actions/setup-java@v5
with:
java-version: |
23
11
distribution: "temurin"

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v5

- name: Start containerized server and dependencies
env:
TEMPORAL_CLI_VERSION: 1.6.1-server-1.31.0-151.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[unrelated] Seems like removing this line is causing test flakes in Nexus tests, not sure why.

run: |
wget -O temporal_cli.tar.gz https://github.com/temporalio/cli/releases/download/v${TEMPORAL_CLI_VERSION}/temporal_cli_${TEMPORAL_CLI_VERSION}_linux_amd64.tar.gz
tar -xzf temporal_cli.tar.gz
chmod +x temporal
./temporal server start-dev \
--headless \
--port 7233 \
--http-port 7243 \
--namespace UnitTest \
--db-filename temporal.sqlite \
--sqlite-pragma journal_mode=WAL \
--sqlite-pragma synchronous=OFF \
--search-attribute CustomKeywordField=Keyword \
--search-attribute CustomStringField=Text \
--search-attribute CustomTextField=Text \
--search-attribute CustomIntField=Int \
--search-attribute CustomDatetimeField=Datetime \
--search-attribute CustomDoubleField=Double \
--search-attribute CustomBoolField=Bool \
--dynamic-config-value system.enableActivityEagerExecution=true \
--dynamic-config-value history.MaxBufferedQueryCount=10000 \
--dynamic-config-value frontend.workerVersioningDataAPIs=true \
--dynamic-config-value history.enableRequestIdRefLinks=true \
--dynamic-config-value 'component.callbacks.allowedAddresses=[{"Pattern":"localhost:7243","AllowInsecure":true}]' &
sleep 10s

- name: Run unit tests
env:
USER: unittest
TEMPORAL_SERVICE_ADDRESS: localhost:7233
USE_DOCKER_SERVICE: true
run: ./gradlew --no-daemon test -x spotlessCheck -x spotlessApply -x spotlessJava

- name: Run Jackson 3 converter tests
env:
USER: unittest
USE_DOCKER_SERVICE: false
run: ./gradlew --no-daemon :temporal-sdk:jackson3Tests -x spotlessCheck -x spotlessApply -x spotlessJava

- name: Run virtual thread tests
env:
USER: unittest
TEMPORAL_SERVICE_ADDRESS: localhost:7233
USE_DOCKER_SERVICE: true
run: ./gradlew --no-daemon :temporal-sdk:virtualThreadTests -x spotlessCheck -x spotlessApply -x spotlessJava

- name: Publish Test Report
uses: mikepenz/action-junit-report@v6
if: success() || failure() # always run even if the previous step fails
with:
report_paths: "**/build/test-results/test/TEST-*.xml"

unit_test_cloud:
name: Unit test with cloud
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repo
uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: recursive
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Java
uses: actions/setup-java@v5
with:
java-version: "11"
distribution: "temurin"

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v5
- name: Run cloud test
# Only supported in non-fork runs, since secrets are not available in forks. We intentionally
# are only doing this check on the step instead of the job so we require job passing in CI
# even for those that can't run this step.
if: ${{ github.event.pull_request.head.repo.full_name == '' || github.event.pull_request.head.repo.full_name == 'temporalio/sdk-java' }}
env:
USER: unittest
TEMPORAL_CLIENT_CLOUD_NAMESPACE: sdk-ci.a2dd6
TEMPORAL_CLIENT_CLOUD_API_KEY: ${{ secrets.TEMPORAL_CLIENT_CLOUD_API_KEY }}
TEMPORAL_CLIENT_CLOUD_API_VERSION: 2024-05-13-00
run: ./gradlew --no-daemon :temporal-sdk:test --tests '*CloudOperationsClientTest'

- name: Publish Test Report
uses: mikepenz/action-junit-report@v6
if: success() || failure() # always run even if the previous step fails
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
- name: Checkout repo
uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: recursive
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Java
uses: actions/setup-java@v5
with:
java-version: "11"
distribution: "temurin"

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v5

- name: Run cloud test
# Only supported in non-fork runs, since secrets are not available in forks. We intentionally
# are only doing this check on the step instead of the job so we require job passing in CI
# even for those that can't run this step.
if: ${{ github.event.pull_request.head.repo.full_name == '' || github.event.pull_request.head.repo.full_name == 'temporalio/sdk-java' }}
env:
USER: unittest
TEMPORAL_CLIENT_CLOUD_NAMESPACE: sdk-ci.a2dd6
TEMPORAL_CLIENT_CLOUD_API_KEY: ${{ secrets.TEMPORAL_CLIENT_CLOUD_API_KEY }}
TEMPORAL_CLIENT_CLOUD_API_VERSION: 2024-05-13-00
run: ./gradlew --no-daemon :temporal-sdk:test --tests '*CloudOperationsClientTest'

- name: Publish Test Report
uses: mikepenz/action-junit-report@v6
if: success() || failure() # always run even if the previous step fails
with:
report_paths: "**/build/test-results/test/TEST-*.xml"

code_format:
name: Code format
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout repo
uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: recursive
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Java
uses: actions/setup-java@v5
with:
java-version: "11"
distribution: "temurin"

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v5
- name: Run copyright and code format checks
run: ./gradlew --no-daemon spotlessCheck
- name: Checkout repo
uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: recursive
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Java
uses: actions/setup-java@v5
with:
java-version: "11"
distribution: "temurin"

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v5

- name: Run copyright and code format checks
run: ./gradlew --no-daemon spotlessCheck

build_native_images:
name: Build native test server
uses: ./.github/workflows/build-native-image.yml
Expand Down
13 changes: 10 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,16 @@ ext {

cronUtilsVersion = '9.2.1' // for test server only

// Spring Boot 3 requires Java 17, java-sdk builds against 2.x version because we support Java 8.
// We do test compatibility with Spring Boot 3 in integration tests.
springBootVersion = project.hasProperty("edgeDepsTest") ? '3.1.12' : '2.7.18'// [2.4.0,)
// This is the version of Spring Boot we use to _build the SDK_. This has to be in the
// range [2.7.0, 3.2.0) at this time, because `@ConstructorBinding` changed path in SB 3.2.0.
springBootVersion = '2.7.18' // [2.7.0, 3.2.0)

// These are the version of Spring Boot we use to test the Spring Boot integration in various
// scenarios. SB 3 and 4 require Java 17, and can therefore only be tested with 'edgeDepsTest'
// enabled. SB 2.x runs on Java 8, and can be tested with or without 'edgeDepsTest' enabled.
springBoot2Version = '2.7.18' // [2.7.0,)
springBoot3Version = '3.5.12' // [3.1.0,)
springBoot4Version = '4.0.2' // [4.0.0,)

// test scoped
// we don't upgrade to 1.3 and 1.4 because they require slf4j 2.x
Expand Down
2 changes: 0 additions & 2 deletions gradle/versioning.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ group = 'io.temporal'
version = getVersionName()

subprojects {
apply plugin: "com.palantir.git-version"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated, but this was causing Gradle error messages in my environment because jgit used internally by com.palantir.git-version doesn't know how to deal with Git worktrees. AFAICS, we're anyway relying on CLI calls to git, rather than use APIs provided by that plugin.


group = 'io.temporal'
version = getVersionName()
}
Loading
Loading