|
17 | 17 | runs-on: ubuntu-latest |
18 | 18 |
|
19 | 19 | strategy: |
| 20 | + fail-fast: false |
20 | 21 | matrix: |
21 | 22 | node-version: [20.x, 22.x, 24.x] |
22 | 23 | mongodb-version: ['6.0', '7.0', '8.0'] |
|
91 | 92 | wait-on: 'http://localhost:3000' |
92 | 93 | wait-on-timeout: 120 |
93 | 94 | command: npm run cypress:run |
| 95 | + |
| 96 | + # Execute a final job to collect the results and report a single check status |
| 97 | + results: |
| 98 | + if: ${{ always() }} |
| 99 | + runs-on: ubuntu-latest |
| 100 | + name: build result |
| 101 | + needs: [build] |
| 102 | + steps: |
| 103 | + - name: Check build results |
| 104 | + run: | |
| 105 | + result="${{ needs.build.result }}" |
| 106 | + if [[ $result == "success" || $result == "skipped" ]]; then |
| 107 | + echo "### ✅ All builds passed" >> $GITHUB_STEP_SUMMARY |
| 108 | + exit 0 |
| 109 | + else |
| 110 | + echo "### ❌ Some builds failed" >> $GITHUB_STEP_SUMMARY |
| 111 | + exit 1 |
| 112 | + fi |
| 113 | +
|
| 114 | + - name: Parse failed matrix jobs |
| 115 | + if: needs.build.result == 'failure' |
| 116 | + run: | |
| 117 | + echo "## Failed Matrix Combinations" >> $GITHUB_STEP_SUMMARY |
| 118 | + echo "" >> $GITHUB_STEP_SUMMARY |
| 119 | + echo "| Node Version | MongoDB Version | Status |" >> $GITHUB_STEP_SUMMARY |
| 120 | + echo "|--------------|-----------------|--------|" >> $GITHUB_STEP_SUMMARY |
| 121 | +
|
| 122 | + # Parse the matrix results from the build job |
| 123 | + results='${{ toJSON(needs.build.outputs) }}' |
| 124 | +
|
| 125 | + # Since we can't directly get individual matrix job statuses, |
| 126 | + # we'll note that the build job failed |
| 127 | + echo "| Multiple | Multiple | ❌ Failed |" >> $GITHUB_STEP_SUMMARY |
| 128 | + echo "" >> $GITHUB_STEP_SUMMARY |
| 129 | + echo "⚠️ Check the [build job logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details on which specific matrix combinations failed." >> $GITHUB_STEP_SUMMARY |
0 commit comments