|
51 | 51 | name: "🧪 ${{ matrix.coordinates }} (GraalVM for JDK ${{ matrix.version }} @ ${{ matrix.os }})" |
52 | 52 | if: needs.get-changed-metadata.outputs.relevant-files-changed == 'true' && needs.get-changed-metadata.result == 'success' && needs.get-changed-metadata.outputs.none-found != 'true' && github.repository == 'oracle/graalvm-reachability-metadata' |
53 | 53 | runs-on: ${{ matrix.os }} |
54 | | - timeout-minutes: 20 |
| 54 | + timeout-minutes: 120 |
55 | 55 | needs: get-changed-metadata |
56 | 56 |
|
57 | 57 | strategy: |
|
87 | 87 | run: | |
88 | 88 | ./gradlew checkMetadataFiles -Pcoordinates=${{ matrix.coordinates }} |
89 | 89 |
|
90 | | - - name: "🧪 Run '${{ matrix.coordinates }}' tests" |
| 90 | + - name: "🧪 Run '${{ matrix.coordinates }}' tests for all tested versions" |
91 | 91 | run: | |
92 | | - ./gradlew test -Pcoordinates=${{ matrix.coordinates }} |
| 92 | + GAV_COORDINATES="${{ matrix.coordinates }}" |
| 93 | + |
| 94 | + # Extract tested versions for the metadata-version from index.json |
| 95 | + GROUP_ID=$(echo "$GAV_COORDINATES" | cut -d: -f1) |
| 96 | + ARTIFACT_ID=$(echo "$GAV_COORDINATES" | cut -d: -f2) |
| 97 | + METADATA_VERSION=$(echo "$GAV_COORDINATES" | cut -d: -f3) |
| 98 | + |
| 99 | + INDEX_FILE="metadata/$GROUP_ID/$ARTIFACT_ID/index.json" |
| 100 | + |
| 101 | + # Build JSON array of tested-version for the metadata-version |
| 102 | + VERSIONS_JSON=$(jq -r --arg mv "$METADATA_VERSION" '.[] | select(.["metadata-version"]==$mv) | ."tested-versions"' "$INDEX_FILE") |
| 103 | + |
| 104 | + # Run tests for all previously tested versions |
| 105 | + bash ./.github/workflows/scripts/run-consecutive-tests.sh "$GAV_COORDINATES" "$VERSIONS_JSON" 2>&1 | tee test_results.txt || true |
| 106 | + |
| 107 | + # Check if any version tested-version failed tests |
| 108 | + if grep -q "^FAILED" test_results.txt; then |
| 109 | + FAILED_VERSION=$(grep "^FAILED" test_results.txt | head -n 1 | awk -F'[][]' '{print $4}') |
| 110 | + echo "Tests failed for version $FAILED_VERSION" |
| 111 | + exit 1 |
| 112 | + fi |
93 | 113 |
|
94 | 114 | all-metadata-passed: |
95 | 115 | name: "🧪 All metadata tests have passed" |
|
0 commit comments