@@ -11,89 +11,46 @@ concurrency:
1111  cancel-in-progress : true 
1212
1313jobs :
14-   opamp- test :
15-     name : " OpAMP Tests (OS: ${{ matrix.os }}, Java: ${{ matrix.java-version }}, Run: ${{ matrix.run_id }}) " 
14+   test :
15+     name : Test 
1616    runs-on : ${{ matrix.os }} 
1717    strategy :
1818      fail-fast : false 
1919      matrix :
20-         os : [ubuntu-latest, windows-latest] 
21-         java-version : [8, 11, 17, 21] 
20+         os :
21+           - ubuntu-latest 
22+           - windows-latest 
23+         test-java-version :
24+           - 8 
25+           - 11 
26+           - 17 
27+           - 21 
28+           - 23 
2229        run_id : [1, 2] 
23-     
2430    steps :
25-       - name : Checkout code 
26-         uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683  #  v4.2.2
31+       - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683  #  v4.2.2
2732
28-       - name : Set up Java ${{ matrix.java-version }} 
33+       - id : setup-java-test 
34+         name : Set up Java ${{ matrix.test-java-version }} for tests 
2935        uses : actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00  #  v4.7.1
3036        with :
3137          distribution : temurin 
32-           java-version : ${{ matrix.java-version }} 
38+           java-version : ${{ matrix.test- java-version }} 
3339
34-       - name : Set up Gradle 
35-         uses : gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96  #  v4.4.1
36-         with :
37-           cache-read-only : false 
38- 
39-       - name : Run OpAMP tests 
40-         run : | 
41-           echo "Running OpAMP tests - OS: ${{ matrix.os }}, Java: ${{ matrix.java-version }}, Iteration: ${{ matrix.run_id }}" 
42-           ./gradlew :opamp-client:test --info --rerun-tasks 
43-          
44-        - name : Upload test results on failure 
45-         uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02  #  v4.6.2
46-         if : failure() 
40+       - id : setup-java 
41+         name : Set up Java for build 
42+         uses : actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00  #  v4.7.1
4743        with :
48-           name : opamp-test-results-${{ matrix.os }}-java${{ matrix.java-version }}-run${{ matrix.run_id }} 
49-           path : | 
50-             opamp-client/build/reports/tests/test/ 
51-             opamp-client/build/test-results/test/ 
52-            retention-days : 7 
44+           distribution : temurin 
45+           java-version : 17 
5346
54-       - name : Upload test logs on failure 
55-         uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02  #  v4.6.2
56-         if : failure() 
47+       - name : Set up gradle 
48+         uses : gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96  #  v4.4.1
5749        with :
58-           name : opamp-test-logs-${{ matrix.os }}-java${{ matrix.java-version }}-run${{ matrix.run_id }} 
59-           path : | 
60-             opamp-client/build/tmp/test/ 
61-             build/tmp/ 
62-            retention-days : 7 
63-           if-no-files-found : ignore 
64- 
65-   summary :
66-     name : Test Summary 
67-     needs : opamp-test 
68-     runs-on : ubuntu-latest 
69-     if : always() 
70-     
71-     steps :
72-       - name : Generate summary 
73-         run : | 
74-           echo "# OpAMP Test Debug Summary" >> $GITHUB_STEP_SUMMARY 
75-           echo "" >> $GITHUB_STEP_SUMMARY 
76-           echo "| OS | Java Version | Run | Status |" >> $GITHUB_STEP_SUMMARY 
77-           echo "|----|--------------|-----|--------|" >> $GITHUB_STEP_SUMMARY 
78-            
79-           for os in ubuntu-latest windows-latest; do 
80-             for java in 8 11 17 21; do 
81-               for run in 1 2; do 
82-                 echo "| $os | $java | $run | Check individual job status above |" >> $GITHUB_STEP_SUMMARY 
83-               done 
84-             done 
85-           done 
86-            
87-           echo "" >> $GITHUB_STEP_SUMMARY 
88-           echo "## Test Matrix Coverage" >> $GITHUB_STEP_SUMMARY 
89-           echo "- **Operating Systems**: Ubuntu Latest, Windows Latest" >> $GITHUB_STEP_SUMMARY 
90-           echo "- **Java Versions**: 8, 11, 17, 21" >> $GITHUB_STEP_SUMMARY 
91-           echo "- **Runs per combination**: 2" >> $GITHUB_STEP_SUMMARY 
92-           echo "- **Total test executions**: 16 (2 OS × 4 Java versions × 2 runs)" >> $GITHUB_STEP_SUMMARY 
93-           echo "" >> $GITHUB_STEP_SUMMARY 
94-           echo "## Instructions" >> $GITHUB_STEP_SUMMARY 
95-           echo "1. Check the individual job results above" >> $GITHUB_STEP_SUMMARY 
96-           echo "2. Download artifacts from failed runs for detailed analysis" >> $GITHUB_STEP_SUMMARY 
97-           echo "3. Look for patterns in test failures across OS/Java version combinations" >> $GITHUB_STEP_SUMMARY 
98-           echo "4. Focus on tests that fail sporadically, not consistently" >> $GITHUB_STEP_SUMMARY 
99-           echo "5. Pay attention to OS-specific or Java version-specific failures" >> $GITHUB_STEP_SUMMARY 
50+           cache-read-only : ${{ github.event_name == 'pull_request' }} 
51+       - name : Gradle test 
52+         run : > 
53+           ./gradlew :opamp-client:test --rerun-tasks 
54+           "-PtestJavaVersion=${{ matrix.test-java-version }}" 
55+           "-Porg.gradle.java.installations.paths=${{ steps.setup-java-test.outputs.path }}" 
56+           "-Porg.gradle.java.installations.auto-download=false" 
0 commit comments