4949 not-ignore:
5050 - '!(docs/**)'
5151
52+ sanity-check :
53+ name : Sanity Check
54+ runs-on : ubuntu-latest
55+ steps :
56+ - uses : actions/checkout@v6
57+ with :
58+ submodules : true
59+ - name : Sanity Check
60+ uses : ./.github/actions/sanity-check
61+ with :
62+ token : ${{ secrets.GITHUB_TOKEN }}
63+
5264 generate-matrix :
5365 name : Generate Module Matrix
5466 runs-on : ubuntu-latest
@@ -84,11 +96,10 @@ jobs:
8496
8597 unit-test :
8698 name : Unit-Test (${{ matrix.module }} | Java ${{ matrix.java }})
87- needs : [ paths-filter, generate-matrix ]
99+ needs : [ paths-filter, generate-matrix, sanity-check ]
88100 if : ${{ (needs.paths-filter.outputs.not-ignore == 'true') || (github.event_name == 'push') }}
89101 runs-on : ubuntu-latest
90102 strategy :
91- fail-fast : false
92103 matrix :
93104 java : [ '8', '11' ]
94105 module : ${{ fromJSON(needs.generate-matrix.outputs.matrix).module }}
@@ -101,11 +112,6 @@ jobs:
101112 - name : Collect Workflow Metrics
102113 uses : ./.github/actions/actions-workflow-metrics
103114
104- - name : Sanity Check
105- uses : ./.github/actions/sanity-check
106- with :
107- token : ${{ secrets.GITHUB_TOKEN }}
108-
109115 - name : Set up JDK ${{ matrix.java }}
110116 uses : actions/setup-java@v5
111117 with :
@@ -264,7 +270,7 @@ jobs:
264270 name : Unit Test
265271 runs-on : ubuntu-latest
266272 timeout-minutes : 5
267- needs : [ unit-test, paths-filter, sonar ]
273+ needs : [ unit-test, paths-filter, sonar, sanity-check ]
268274 if : always()
269275 steps :
270276 - name : Status
@@ -273,6 +279,10 @@ jobs:
273279 echo "Skip Unit Test!"
274280 exit 0
275281 fi
282+ if [[ ${{ needs.sanity-check.result }} != 'success' ]]; then
283+ echo "Sanity Check Failed!"
284+ exit -1
285+ fi
276286 if [[ ${{ needs.unit-test.result }} != 'success' ]]; then
277287 echo "Unit Test Failed!"
278288 exit -1
0 commit comments