diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index d4d51124f..8e96e8262 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -142,6 +142,28 @@ jobs: mkdir -p ${{ env.CT_RESULT_DIR }} ARCANE_CHECK=1 ctest --test-dir ${{ env.BUILD_DIR }} --output-junit ${{ env.CT_RESULT_DIR }}/results.xml ${{ env.CT_OPTS }} -E '${{ env.EXCLUDED_TESTS }}' -LE '${{ env.EXCLUDED_TESTS_WITH_LABELS }}' + # https://www.ibm.com/docs/en/developer-for-zos/9.1.1?topic=formats-junit-xml-format + - name: Edit results.xml for Codecov (need valid JUnit XML) + shell: bash + run: | + RESULT_ORI=${{ env.CT_RESULT_DIR }}/results.xml + RESULT_TMP=${{ env.CT_RESULT_DIR }}/results_ori.xml + mv $RESULT_ORI $RESULT_TMP + sed -e '//,/<\/testcase>/d' -e 's:::' -e 's/(empty)/CTest Arcane/' -e 's/hostname=""/hostname="GHA"/' $RESULT_TMP > $RESULT_ORI + sed -n '//,/<\/testcase>/p' $RESULT_TMP | sed -e 's:::M' -e 's//\n/M' -e 's:::M' >> $RESULT_ORI + sed -n '//,/<\/testcase>/p' $RESULT_TMP >> $RESULT_ORI + echo '' >> $RESULT_ORI + rm $RESULT_TMP + + - name: Upload test results to Codecov + uses: codecov/test-results-action@v1 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + verbose: true + fail_ci_if_error: true + file: ${{ env.CT_RESULT_DIR }}/results.xml + - name: Display disks infos shell: bash run: |