diff --git a/.github/workflows/test.docs.yml b/.github/workflows/test.docs.yml index 688e6c5b..3e4cb83e 100644 --- a/.github/workflows/test.docs.yml +++ b/.github/workflows/test.docs.yml @@ -48,5 +48,8 @@ jobs: run: | npm install npm run docs:generate - bash -c "if (( $(sed -nE 's/.*>([0-9]{1,3})%<.*/\1/p' docs/coverage.svg | head -1) > $COVERAGE_REQUIRED )) then echo \"echo "Coverage: $(sed -nE 's/.*>([0-9]{1,3})%<.*/\1/p' docs/coverage.svg | head -1)/$COVERAGE_REQUIRED\";exit 0; else exit 1; fi" + ./scripts/docs-coverage.sh working-directory: ./ + + +bash -c "COVERAGE=$(sed -nE 's/.*>([0-9]{1,3})%<.*/\1/p' docs/coverage.svg | head -1); echo $COVERAGE;if (( $COVERAGE >= $COVERAGE_REQUIRED )) then exit 0; else echo \"Coverage: $COVERAGE/$COVERAGE_REQUIRED\"; exit 1; fi" \ No newline at end of file diff --git a/scripts/docs-coverage.sh b/scripts/docs-coverage.sh new file mode 100755 index 00000000..97ad4b10 --- /dev/null +++ b/scripts/docs-coverage.sh @@ -0,0 +1,9 @@ +#!/bin/bash +COVERAGE=$(sed -nE 's/.*>([0-9]{1,3})%<.*/\1/p' docs/coverage.svg | head -1) + +if (( $COVERAGE >= $COVERAGE_REQUIRED )) then + exit 0; +else + echo "Coverage: $COVERAGE/$COVERAGE_REQUIRED"; + exit 1; +fi \ No newline at end of file