Skip to content

Commit d7c4fe8

Browse files
committed
Try to repro
1 parent 0b01a95 commit d7c4fe8

File tree

1 file changed

+51
-83
lines changed

1 file changed

+51
-83
lines changed

.github/workflows/build-common.yml

Lines changed: 51 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,63 @@ jobs:
130130
matrix:
131131
test-java-version:
132132
- 8
133-
- 11
134-
- 17
135-
- 21
136-
- 23
137133
vm:
138134
- hotspot
139135
# TODO (trask) enable once profiler supports OpenJ9
140136
# - openj9
141137
os:
142138
- windows-2022
143-
- ubuntu-latest
139+
num:
140+
- 1
141+
- 2
142+
- 3
143+
- 4
144+
- 5
145+
- 6
146+
- 7
147+
- 8
148+
- 9
149+
- 10
150+
- 11
151+
- 12
152+
- 13
153+
- 14
154+
- 15
155+
- 16
156+
- 17
157+
- 18
158+
- 19
159+
- 20
160+
- 21
161+
- 22
162+
- 23
163+
- 24
164+
- 25
165+
- 26
166+
- 27
167+
- 28
168+
- 29
169+
- 30
170+
- 31
171+
- 32
172+
- 33
173+
- 34
174+
- 35
175+
- 36
176+
- 37
177+
- 38
178+
- 39
179+
- 40
180+
- 41
181+
- 42
182+
- 43
183+
- 44
184+
- 45
185+
- 46
186+
- 47
187+
- 48
188+
- 49
189+
- 50
144190
fail-fast: false
145191
steps:
146192
- name: Support long paths
@@ -181,81 +227,3 @@ jobs:
181227
"-Porg.gradle.java.installations.paths=${{ steps.setup-test-java.outputs.path }}"
182228
"-Porg.gradle.java.installations.auto-download=false"
183229
${{ inputs.no-build-cache && ' --no-build-cache' || '' }}
184-
185-
setup-smoke-test-matrix:
186-
runs-on: ubuntu-latest
187-
outputs:
188-
matrix: ${{ steps.set-matrix.outputs.matrix }}
189-
steps:
190-
- uses: actions/checkout@v4
191-
192-
- id: set-matrix
193-
run: |
194-
json_array=$(
195-
for dir in smoke-tests/apps/*; do
196-
# Convert directory path to module name (e.g., "smoke-tests/apps/MyApp" -> "smoke-tests:apps:MyApp")
197-
module=$(echo "$dir" | sed 's|/|:|g')
198-
# Extract just the app name from the module path (e.g., "smoke-tests:apps:MyApp" -> "MyApp")
199-
module_short=$(echo "$module" | sed 's|.*:||')
200-
201-
find "${dir}/src/smokeTest/java" -name "*Test.java" | \
202-
# Remove the base path to get relative path from smokeTest/java
203-
sed "s|${dir}/src/smokeTest/java/||" | \
204-
# Convert file name to class name (e.g., "com/example/MyTest.java" -> "com.example.MyTest")
205-
sed 's|/|.|g' | sed 's|\.java$||' | \
206-
# Process each fully qualified test class name
207-
while read -r class_name; do
208-
# Extract just the simple class name (e.g., "com.example.MyTest" -> "MyTest")
209-
class_short=$(echo "$class_name" | sed 's/.*\.//')
210-
echo "{\"display\":\"${module_short}:${class_short}\"," \
211-
"\"module\":\"${module}\"," \
212-
"\"test_class\":\"${class_name}\"}"
213-
done
214-
# Join all JSON objects with commas and remove trailing comma
215-
done | tr '\n' ',' | sed 's/,$//'
216-
)
217-
218-
# Output the matrix in GitHub Actions format
219-
echo "matrix={\"include\":[$json_array]}" >> $GITHUB_OUTPUT
220-
221-
smoke-test:
222-
name: ${{ matrix.display }}
223-
needs: setup-smoke-test-matrix
224-
runs-on: ubuntu-latest
225-
strategy:
226-
matrix: ${{fromJson(needs.setup-smoke-test-matrix.outputs.matrix)}}
227-
fail-fast: false
228-
steps:
229-
- uses: actions/checkout@v4
230-
231-
- name: Set up Java 17
232-
uses: actions/setup-java@v4
233-
with:
234-
distribution: temurin
235-
java-version: 17
236-
237-
- name: Build and install local azure-monitor-opentelemetry-autoconfigure dependency
238-
if: env.AZURE_MONITOR_OPENTELEMETRY_AUTOCONFIGURE != ''
239-
run: ./.github/scripts/build-azure-monitor-dependency.sh
240-
241-
- name: Setup Gradle
242-
uses: gradle/actions/setup-gradle@v4
243-
244-
- name: Test
245-
run: ./gradlew ${{ matrix.module }}:smokeTest --tests "${{ matrix.test_class }}*"
246-
247-
- name: Create unique artifact name
248-
if: failure()
249-
run: |
250-
# Create a unique name based on module and test class
251-
artifact_name="${{ matrix.module }}:${{ matrix.test_class }}"
252-
# Replace colons and dots with hyphens for valid artifact names
253-
artifact_name=$(echo "$artifact_name" | sed 's/[:.]/\-/g')
254-
echo "UPLOAD_ARTIFACT_NAME=$artifact_name" >> $GITHUB_ENV
255-
256-
- name: Upload smoke test reports
257-
uses: actions/upload-artifact@v4
258-
if: failure()
259-
with:
260-
name: ${{ env.UPLOAD_ARTIFACT_NAME }}
261-
path: '**/build/reports/tests/smokeTest/**/*'

0 commit comments

Comments
 (0)