diff --git a/.github/workflows/app-test-coverage-pr.yml b/.github/workflows/app-test-coverage-pr.yml index 3073c2df..5fec6e7b 100644 --- a/.github/workflows/app-test-coverage-pr.yml +++ b/.github/workflows/app-test-coverage-pr.yml @@ -44,7 +44,7 @@ jobs: env: GITHUB_USERNAME: ${{ vars.GITHUB_ACTOR }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: ./gradlew test + run: ./gradlew test -PtestIgnoreFailures > test_output.txt - name: Get coverage if: always() @@ -70,3 +70,18 @@ jobs: min-coverage-overall: 80 min-coverage-changed-files: 80 title: Coverage Report + + - name: Fail pipeline, when there are failed tests + run: | + RESULT=$(grep FAILED test_output.txt | wc -l | xargs) + + echo "Found 'FAILED' tests: $RESULT" + + if [[ $RESULT -gt 0 ]] + then + echo "Tests failed!" + exit 1 + else + echo "Tests OK!" + exit 0 + fi