Skip to content

Commit a9917fd

Browse files
committed
go back to original CI, create UnitTest namespace if needed
1 parent dc4e15a commit a9917fd

File tree

2 files changed

+191
-171
lines changed

2 files changed

+191
-171
lines changed

.github/workflows/ci.yml

Lines changed: 164 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -13,193 +13,193 @@ jobs:
1313
runs-on: ubuntu-latest-16-cores
1414
timeout-minutes: 30
1515
steps:
16-
- name: Checkout repo
17-
uses: actions/checkout@v4
18-
with:
19-
fetch-depth: 0
20-
submodules: recursive
21-
ref: ${{ github.event.pull_request.head.sha }}
22-
23-
- name: Set up Java
24-
uses: actions/setup-java@v4
25-
with:
26-
java-version: "23"
27-
distribution: "temurin"
28-
29-
- name: Set up Gradle
30-
uses: gradle/actions/setup-gradle@v4
31-
32-
- name: Run unit tests
33-
env:
34-
USER: unittest
35-
USE_DOCKER_SERVICE: false
36-
run: |
37-
echo "use docker service:$USE_DOCKER_SERVICE"
38-
echo "user $USER"
39-
./gradlew --no-daemon test -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest
40-
41-
- name: Run independent resource tuner test
42-
env:
43-
USER: unittest
44-
USE_DOCKER_SERVICE: false
45-
run: ./gradlew --no-daemon temporal-sdk:testResourceIndependent -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest
46-
47-
- name: Publish Test Report
48-
uses: mikepenz/action-junit-report@v5
49-
if: success() || failure() # always run even if the previous step fails
50-
with:
51-
report_paths: "**/build/test-results/test/TEST-*.xml"
16+
- name: Checkout repo
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
submodules: recursive
21+
ref: ${{ github.event.pull_request.head.sha }}
22+
23+
- name: Set up Java
24+
uses: actions/setup-java@v4
25+
with:
26+
java-version: "23"
27+
distribution: "temurin"
28+
29+
- name: Set up Gradle
30+
uses: gradle/actions/setup-gradle@v4
31+
32+
- name: Run unit tests
33+
env:
34+
USER: unittest
35+
USE_DOCKER_SERVICE: false
36+
run: ./gradlew --no-daemon test -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest
37+
38+
- name: Run independent resource tuner test
39+
env:
40+
USER: unittest
41+
USE_DOCKER_SERVICE: false
42+
run: |
43+
echo "USER: $USER"
44+
echo "USE_DOCKER_SERVICE: $USE_DOCKER_SERVICE"
45+
./gradlew --no-daemon temporal-sdk:testResourceIndependent -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest
46+
47+
- name: Publish Test Report
48+
uses: mikepenz/action-junit-report@v5
49+
if: success() || failure() # always run even if the previous step fails
50+
with:
51+
report_paths: '**/build/test-results/test/TEST-*.xml'
5252

5353
unit_test_jdk8:
5454
name: Unit test with docker service [JDK8]
5555
runs-on: ubuntu-latest-16-cores
5656
timeout-minutes: 30
5757
steps:
58-
- name: Checkout repo
59-
uses: actions/checkout@v4
60-
with:
61-
fetch-depth: 0
62-
submodules: recursive
63-
ref: ${{ github.event.pull_request.head.sha }}
64-
65-
- name: Set up Java
66-
uses: actions/setup-java@v4
67-
with:
68-
java-version: |
69-
23
70-
11
71-
distribution: "temurin"
72-
73-
- name: Set up Gradle
74-
uses: gradle/actions/setup-gradle@v4
75-
76-
- name: Start containerized server and dependencies
77-
env:
78-
TEMPORAL_CLI_VERSION: 1.4.0
79-
run: |
80-
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
81-
tar -xzf temporal_cli.tar.gz
82-
chmod +x temporal
83-
./temporal server start-dev \
84-
--headless \
85-
--port 7233 \
86-
--http-port 7243 \
87-
--namespace UnitTest \
88-
--db-filename temporal.sqlite \
89-
--sqlite-pragma journal_mode=WAL \
90-
--sqlite-pragma synchronous=OFF \
91-
--search-attribute CustomKeywordField=Keyword \
92-
--search-attribute CustomStringField=Text \
93-
--search-attribute CustomTextField=Text \
94-
--search-attribute CustomIntField=Int \
95-
--search-attribute CustomDatetimeField=Datetime \
96-
--search-attribute CustomDoubleField=Double \
97-
--search-attribute CustomBoolField=Bool \
98-
--dynamic-config-value system.forceSearchAttributesCacheRefreshOnRead=true \
99-
--dynamic-config-value system.enableActivityEagerExecution=true \
100-
--dynamic-config-value system.enableEagerWorkflowStart=true \
101-
--dynamic-config-value system.enableExecuteMultiOperation=true \
102-
--dynamic-config-value frontend.enableUpdateWorkflowExecutionAsyncAccepted=true \
103-
--dynamic-config-value history.MaxBufferedQueryCount=100000 \
104-
--dynamic-config-value frontend.workerVersioningDataAPIs=true \
105-
--dynamic-config-value worker.buildIdScavengerEnabled=true \
106-
--dynamic-config-value frontend.workerVersioningRuleAPIs=true \
107-
--dynamic-config-value worker.removableBuildIdDurationSinceDefault=true \
108-
--dynamic-config-value matching.useNewMatcher=true \
109-
--dynamic-config-value system.refreshNexusEndpointsMinWait=1000 \
110-
--dynamic-config-value component.callbacks.allowedAddresses='[{"Pattern":"*","AllowInsecure":true}]' \
111-
--dynamic-config-value component.nexusoperations.recordCancelRequestCompletionEvents=true \
112-
--dynamic-config-value frontend.workerVersioningWorkflowAPIs=true \
113-
--dynamic-config-value frontend.activityAPIsEnabled=true \
114-
--dynamic-config-value system.enableDeploymentVersions=true \
115-
--dynamic-config-value history.enableRequestIdRefLinks=true &
116-
sleep 10s
117-
118-
- name: Run unit tests
119-
env:
120-
USER: unittest
121-
TEMPORAL_SERVICE_ADDRESS: localhost:7233
122-
USE_DOCKER_SERVICE: true
123-
run: ./gradlew --no-daemon test -x spotlessCheck -x spotlessApply -x spotlessJava
124-
125-
- name: Run virtual thread tests
126-
env:
127-
USER: unittest
128-
TEMPORAL_SERVICE_ADDRESS: localhost:7233
129-
USE_DOCKER_SERVICE: true
130-
run: ./gradlew --no-daemon :temporal-sdk:virtualThreadTests -x spotlessCheck -x spotlessApply -x spotlessJava
131-
132-
- name: Publish Test Report
133-
uses: mikepenz/action-junit-report@v5
134-
if: success() || failure() # always run even if the previous step fails
135-
with:
136-
report_paths: "**/build/test-results/test/TEST-*.xml"
58+
- name: Checkout repo
59+
uses: actions/checkout@v4
60+
with:
61+
fetch-depth: 0
62+
submodules: recursive
63+
ref: ${{ github.event.pull_request.head.sha }}
64+
65+
- name: Set up Java
66+
uses: actions/setup-java@v4
67+
with:
68+
java-version: |
69+
23
70+
11
71+
distribution: "temurin"
72+
73+
- name: Set up Gradle
74+
uses: gradle/actions/setup-gradle@v4
75+
76+
- name: Start containerized server and dependencies
77+
env:
78+
TEMPORAL_CLI_VERSION: 1.4.0
79+
run: |
80+
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
81+
tar -xzf temporal_cli.tar.gz
82+
chmod +x temporal
83+
./temporal server start-dev \
84+
--headless \
85+
--port 7233 \
86+
--http-port 7243 \
87+
--namespace UnitTest \
88+
--db-filename temporal.sqlite \
89+
--sqlite-pragma journal_mode=WAL \
90+
--sqlite-pragma synchronous=OFF \
91+
--search-attribute CustomKeywordField=Keyword \
92+
--search-attribute CustomStringField=Text \
93+
--search-attribute CustomTextField=Text \
94+
--search-attribute CustomIntField=Int \
95+
--search-attribute CustomDatetimeField=Datetime \
96+
--search-attribute CustomDoubleField=Double \
97+
--search-attribute CustomBoolField=Bool \
98+
--dynamic-config-value system.forceSearchAttributesCacheRefreshOnRead=true \
99+
--dynamic-config-value system.enableActivityEagerExecution=true \
100+
--dynamic-config-value system.enableEagerWorkflowStart=true \
101+
--dynamic-config-value system.enableExecuteMultiOperation=true \
102+
--dynamic-config-value frontend.enableUpdateWorkflowExecutionAsyncAccepted=true \
103+
--dynamic-config-value history.MaxBufferedQueryCount=100000 \
104+
--dynamic-config-value frontend.workerVersioningDataAPIs=true \
105+
--dynamic-config-value worker.buildIdScavengerEnabled=true \
106+
--dynamic-config-value frontend.workerVersioningRuleAPIs=true \
107+
--dynamic-config-value worker.removableBuildIdDurationSinceDefault=true \
108+
--dynamic-config-value matching.useNewMatcher=true \
109+
--dynamic-config-value system.refreshNexusEndpointsMinWait=1000 \
110+
--dynamic-config-value component.callbacks.allowedAddresses='[{"Pattern":"*","AllowInsecure":true}]' \
111+
--dynamic-config-value component.nexusoperations.recordCancelRequestCompletionEvents=true \
112+
--dynamic-config-value frontend.workerVersioningWorkflowAPIs=true \
113+
--dynamic-config-value frontend.activityAPIsEnabled=true \
114+
--dynamic-config-value system.enableDeploymentVersions=true \
115+
--dynamic-config-value history.enableRequestIdRefLinks=true &
116+
sleep 10s
117+
118+
- name: Run unit tests
119+
env:
120+
USER: unittest
121+
TEMPORAL_SERVICE_ADDRESS: localhost:7233
122+
USE_DOCKER_SERVICE: true
123+
run: ./gradlew --no-daemon test -x spotlessCheck -x spotlessApply -x spotlessJava
124+
125+
- name: Run virtual thread tests
126+
env:
127+
USER: unittest
128+
TEMPORAL_SERVICE_ADDRESS: localhost:7233
129+
USE_DOCKER_SERVICE: true
130+
run: ./gradlew --no-daemon :temporal-sdk:virtualThreadTests -x spotlessCheck -x spotlessApply -x spotlessJava
131+
132+
- name: Publish Test Report
133+
uses: mikepenz/action-junit-report@v5
134+
if: success() || failure() # always run even if the previous step fails
135+
with:
136+
report_paths: '**/build/test-results/test/TEST-*.xml'
137137

138138
unit_test_cloud:
139139
name: Unit test with cloud
140140
runs-on: ubuntu-latest
141141
timeout-minutes: 30
142142
steps:
143-
- name: Checkout repo
144-
uses: actions/checkout@v4
145-
with:
146-
fetch-depth: 0
147-
submodules: recursive
148-
ref: ${{ github.event.pull_request.head.sha }}
149-
150-
- name: Set up Java
151-
uses: actions/setup-java@v4
152-
with:
153-
java-version: "11"
154-
distribution: "temurin"
155-
156-
- name: Set up Gradle
157-
uses: gradle/actions/setup-gradle@v4
158-
159-
- name: Run cloud test
160-
# Only supported in non-fork runs, since secrets are not available in forks. We intentionally
161-
# are only doing this check on the step instead of the job so we require job passing in CI
162-
# even for those that can't run this step.
163-
if: ${{ github.event.pull_request.head.repo.full_name == '' || github.event.pull_request.head.repo.full_name == 'temporalio/sdk-java' }}
164-
env:
165-
USER: unittest
166-
TEMPORAL_CLIENT_CLOUD_NAMESPACE: sdk-ci.a2dd6
167-
TEMPORAL_CLIENT_CLOUD_API_KEY: ${{ secrets.TEMPORAL_CLIENT_CLOUD_API_KEY }}
168-
TEMPORAL_CLIENT_CLOUD_API_VERSION: 2024-05-13-00
169-
run: ./gradlew --no-daemon :temporal-sdk:test --tests '*CloudOperationsClientTest'
170-
171-
- name: Publish Test Report
172-
uses: mikepenz/action-junit-report@v5
173-
if: success() || failure() # always run even if the previous step fails
174-
with:
175-
report_paths: "**/build/test-results/test/TEST-*.xml"
143+
- name: Checkout repo
144+
uses: actions/checkout@v4
145+
with:
146+
fetch-depth: 0
147+
submodules: recursive
148+
ref: ${{ github.event.pull_request.head.sha }}
149+
150+
- name: Set up Java
151+
uses: actions/setup-java@v4
152+
with:
153+
java-version: "11"
154+
distribution: "temurin"
155+
156+
- name: Set up Gradle
157+
uses: gradle/actions/setup-gradle@v4
158+
159+
- name: Run cloud test
160+
# Only supported in non-fork runs, since secrets are not available in forks. We intentionally
161+
# are only doing this check on the step instead of the job so we require job passing in CI
162+
# even for those that can't run this step.
163+
if: ${{ github.event.pull_request.head.repo.full_name == '' || github.event.pull_request.head.repo.full_name == 'temporalio/sdk-java' }}
164+
env:
165+
USER: unittest
166+
TEMPORAL_CLIENT_CLOUD_NAMESPACE: sdk-ci.a2dd6
167+
TEMPORAL_CLIENT_CLOUD_API_KEY: ${{ secrets.TEMPORAL_CLIENT_CLOUD_API_KEY }}
168+
TEMPORAL_CLIENT_CLOUD_API_VERSION: 2024-05-13-00
169+
run: ./gradlew --no-daemon :temporal-sdk:test --tests '*CloudOperationsClientTest'
170+
171+
- name: Publish Test Report
172+
uses: mikepenz/action-junit-report@v5
173+
if: success() || failure() # always run even if the previous step fails
174+
with:
175+
report_paths: '**/build/test-results/test/TEST-*.xml'
176176

177177
code_format:
178178
name: Code format
179179
runs-on: ubuntu-latest
180180
timeout-minutes: 20
181181
steps:
182-
- name: Checkout repo
183-
uses: actions/checkout@v4
184-
with:
185-
fetch-depth: 0
186-
submodules: recursive
187-
ref: ${{ github.event.pull_request.head.sha }}
182+
- name: Checkout repo
183+
uses: actions/checkout@v4
184+
with:
185+
fetch-depth: 0
186+
submodules: recursive
187+
ref: ${{ github.event.pull_request.head.sha }}
188188

189-
- name: Set up Java
190-
uses: actions/setup-java@v4
191-
with:
192-
java-version: "11"
193-
distribution: "temurin"
189+
- name: Set up Java
190+
uses: actions/setup-java@v4
191+
with:
192+
java-version: "11"
193+
distribution: "temurin"
194194

195-
- name: Set up Gradle
196-
uses: gradle/actions/setup-gradle@v4
195+
- name: Set up Gradle
196+
uses: gradle/actions/setup-gradle@v4
197197

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

201201
build_native_images:
202202
name: Build native test server
203203
uses: ./.github/workflows/build-native-image.yml
204204
with:
205-
ref: ${{ github.event.pull_request.head.sha }}
205+
ref: ${{ github.event.pull_request.head.sha }}

0 commit comments

Comments
 (0)