|
66 | 66 | echo "include_test_modules=" >> $GITHUB_OUTPUT
|
67 | 67 | echo "exclude_test_modules=" >> $GITHUB_OUTPUT
|
68 | 68 | echo "exclude_tests=" >> $GITHUB_OUTPUT
|
| 69 | +
|
| 70 | + # This is currently checking for invalid trigger only. |
| 71 | + if [[ "${{ github.event_name }}" == "schedule" ]]; then |
| 72 | + # Do nothing for now |
| 73 | + : |
| 74 | + elif [[ "${{ github.event_name }}" == "pull_request" ]]; then |
| 75 | + if [[ "${{ github.event.action }}" == "labeled" && "${{ github.event.label.name }}" == "tests-requested" ]]; then |
| 76 | + # Do nothing for now |
| 77 | + : |
| 78 | + elif [[ "${{ github.event.action }}" == "closed" && "${{ github.event.pull_request.merged == true}}" == "true" ]]; then |
| 79 | + # Do nothing for now |
| 80 | + : |
| 81 | + else |
| 82 | + echo "invalid_trigger=1" >> $GITHUB_OUTPUT |
| 83 | + fi |
| 84 | + else |
| 85 | + echo "invalid_trigger=1" >> $GITHUB_OUTPUT |
| 86 | + fi |
69 | 87 | fi
|
70 | 88 |
|
| 89 | + - name: Cancel workflow |
| 90 | + if: ${{ steps.set_outputs.outputs.invalid_trigger }} |
| 91 | + uses: andymckay/cancel-action@0.2 |
| 92 | + |
| 93 | + - name: Wait for workflow cancellation |
| 94 | + if: ${{ steps.set_outputs.outputs.invalid_trigger }} |
| 95 | + run: | |
| 96 | + sleep 300 |
| 97 | + exit 1 # fail out if the cancellation above somehow failed. |
| 98 | +
|
71 | 99 | - name: Print output
|
72 | 100 | run: |
|
73 | 101 | echo outputs.unity_version : ${{ steps.set_outputs.outputs.unity_version }}
|
@@ -119,14 +147,15 @@ jobs:
|
119 | 147 | continue-on-error: true
|
120 | 148 | run: cat test_output/test*IntegrationTestsBatchMode/*.log
|
121 | 149 |
|
122 |
| - - name: Obtain Failed tests |
| 150 | + - name: Obtain Failed tests from Integration tests and NUnit tests |
123 | 151 | if: always()
|
124 | 152 | shell: bash
|
125 | 153 | continue-on-error: true
|
126 | 154 | run: |
|
127 |
| - cat test_output/test*/*_test.log | grep "^Test .* PASSED$" |
128 |
| - cat test_output/test*/*_test.log | grep "^Test .* FAILED$" |
129 |
| - cat test_output/test*/*_test.log | grep "^Test .* SKIPPED$" |
| 155 | + # Quick and dirty way to get all failed tests in granular level. |
| 156 | + # TODO: better parser for more information, ex. error message. |
| 157 | + { cat test_output/test*/*_test.log || true; } | { grep "^Test .* FAILED$" || true; } |
| 158 | + { cat test_output/test*/test*/results.xml || true; } | { grep '^ *<test-case.*result="Failed"' || true; } | sed 's/^.* name="\([^\"]*\)".*$/Test \1: FAILED/' |
130 | 159 |
|
131 | 160 | - name: Return Unity license
|
132 | 161 | if: always()
|
|
0 commit comments