@@ -85,16 +85,58 @@ jobs:
8585 if : ${{ always() }}
8686 id : cli-messaging-tests
8787 run : yarn test-cli-messaging
88+ - if : ${{ failure() && steps.cli-messaging-tests.outcome != 'success' }}
89+ uses : ./github-actions/summarize-errors
90+ with :
91+ location : " ${{github.workspace}}/cli-messaging"
92+ project-name : " cli-messaging"
93+ artifact-name : cli-messaging-tests-${{ runner.os }}-${{ matrix.java }}-${{ matrix.node.artifact }}
94+ framework : " junit"
95+ - if : ${{ failure() && steps.cli-messaging-tests.outcome != 'success' }}
96+ uses : actions/upload-artifact@v3
97+ with :
98+ name : cli-messaging-tests-${{ runner.os }}-${{ matrix.java }}-${{ matrix.node.artifact }}
99+ path : |
100+ ./cli-messaging/build/reports
101+ ./cli-messaging/build/test-results
88102 # 2. PMD Cataloger project.
89103 - name : PMD Cataloger Tests And Coverage
90104 id : pmd-cataloger-tests
91105 if : ${{ always() }}
92106 run : yarn test-pmd-cataloger
107+ - if : ${{ failure() && steps.pmd-cataloger-tests.outcome != 'success' }}
108+ uses : ./github-actions/summarize-errors
109+ with :
110+ location : " ${{github.workspace}}/pmd-cataloger"
111+ project-name : " pmd-cataloger"
112+ artifact-name : pmd-cataloger-tests-${{ runner.os }}-${{ matrix.java }}-${{ matrix.node.artifact }}
113+ framework : " junit"
114+ - if : ${{ failure() && steps.pmd-cataloger-tests.outcome != 'success' }}
115+ uses : actions/upload-artifact@v3
116+ with :
117+ name : pmd-cataloger-tests-${{ runner.os }}-${{ matrix.java }}-${{ matrix.node.artifact }}
118+ path : |
119+ ./pmd-cataloger/build/reports
120+ ./pmd-cataloger/build/test-results
93121 # 3. SFGE project. (NOTE: We use the quiet variant so the logs don't blow up the console.)
94122 - name : SFGE Tests And Coverage
95123 id : sfge-tests
96124 if : ${{ always() }}
97125 run : yarn test-sfge-quiet
126+ - if : ${{ failure() && steps.sfge-tests.outcome != 'success' }}
127+ uses : ./github-actions/summarize-errors
128+ with :
129+ location : " ${{github.workspace}}/sfge"
130+ project-name : " sfge"
131+ artifact-name : sfge-tests-${{ runner.os }}-${{ matrix.java }}-${{ matrix.node.artifact }}
132+ framework : " junit"
133+ - if : ${{ failure() && steps.sfge-tests.outcome != 'success' }}
134+ uses : actions/upload-artifact@v3
135+ with :
136+ name : sfge-tests-${{ runner.os }}-${{ matrix.java }}-${{ matrix.node.artifact }}
137+ path : |
138+ ./sfge/build/reports
139+ ./sfge/build/test-results
98140 # 4. Typescript project.
99141 - name : Typescript Tests And Coverage
100142 id : typescript-tests
@@ -104,12 +146,24 @@ jobs:
104146 id : typescript-linting
105147 if : ${{ always() }}
106148 run : yarn lint-typescript -f junit -o typescript-test-results/eslint/lint-results.xml
107- # Upload the test results and coverage as an artifact
108- - name : Upload artifact
149+ - if : ${{ failure() && (steps.typescript-tests.outcome != 'success' || steps.typescript-linting.outcome != 'success') }}
150+ uses : ./github-actions/summarize-errors
151+ with :
152+ location : " ${{github.workspace}}/typescript-test-results"
153+ project-name : " typescript"
154+ artifact-name : typescript-tests-${{ runner.os }}-${{ matrix.java }}-${{ matrix.node.artifact }}
155+ framework : " mocha"
156+ - if : ${{ failure() && (steps.typescript-tests.outcome != 'success' || steps.typescript-linting.outcome != 'success') }}
157+ uses : actions/upload-artifact@v3
158+ with :
159+ name : typescript-tests-${{ runner.os }}-${{ matrix.java }}-${{ matrix.node.artifact }}
160+ path : |
161+ ./typescript-test-results
162+ - name : Upload full artifact
109163 if : ${{ always() }}
110164 uses : actions/upload-artifact@v3
111165 with :
112- name : test-results- ${{ runner.os }}-jvm- ${{ matrix.java }}-node -${{ matrix.node.artifact }}
166+ name : all-unit-tests- ${{ runner.os }}-${{ matrix.java }}-${{ matrix.node.artifact }}
113167 path : |
114168 ./typescript-test-results
115169 ./pmd-cataloger/build/reports
@@ -118,36 +172,6 @@ jobs:
118172 ./sfge/build/test-results
119173 ./cli-messaging/build/reports
120174 ./cli-messaging/build/test-results
121- # If any of the steps failed, we need to report that.
122- # TODO: In the future, we could replace this step with a JS-based one that uses `core.setFailed()` to set a failure
123- # message in the annotations.
124- - name : Report failures
125- if : ${{ failure() || cancelled() }}
126- shell : bash
127- env :
128- CLI_MESSAGING_FAILED : ${{ steps.cli-messaging-tests.outcome == 'failure' }}
129- PMD_CATALOGER_FAILED : ${{ steps.pmd-cataloger-tests.outcome == 'failure' }}
130- SFGE_FAILED : ${{ steps.sfge-tests.outcome == 'failure' }}
131- TYPESCRIPT_TESTS_FAILED : ${{ steps.typescript-tests.outcome == 'failure' }}
132- TYPESCRIPT_LINTING_FAILED : ${{ steps.typescript-linting.outcome == 'failure' }}
133- run : |
134- if [[ ${{ env.CLI_MESSAGING_FAILED }} == true ]]; then
135- echo "cli-messaging had test failures"
136- fi
137- if [[ ${{ env.PMD_CATALOGER_FAILED }} == true ]]; then
138- echo "pmd-cataloger had test failures and/or insufficient code coverage"
139- fi
140- if [[ ${{ env.SFGE_FAILED }} == true ]]; then
141- echo "sfge had test failures and/or insufficient code coverage"
142- fi
143- if [[ ${{ env.TYPESCRIPT_TESTS_FAILED }} == true ]]; then
144- echo "typescript had test failures and/or insufficient code coverage"
145- fi
146- if [[ ${{ env.TYPESCRIPT_LINTING_FAILED }} == true ]]; then
147- echo "typescript had linting issues"
148- fi
149- echo "For more information, consult the failed steps' logs and the artifact for this run"
150- exit 1
151175 # Step 2B: Run the smoke tests
152176 smoke-tests :
153177 strategy :
0 commit comments