|
34 | 34 | path: source |
35 | 35 |
|
36 | 36 | - name: Install Coverage Analysis Tools |
37 | | - if: ${{ matrix.build-type == 'Debug' && matrix.base-os == 'ubuntu-20.04' }} |
| 37 | + if: ${{ matrix.build-type == 'Debug' }} |
38 | 38 | run: sudo apt-get install -y lcov xsltproc && echo "run_lcov=TRUE" >> $GITHUB_ENV |
39 | 39 |
|
40 | 40 | - name: Set up debug environment |
@@ -89,23 +89,44 @@ jobs: |
89 | 89 | binary-dir: build |
90 | 90 |
|
91 | 91 | - name: Enforce coverage function minimum |
92 | | - if: ${{ always() && steps.stats.outputs.ncov_functions > env.allowed_ncov_functions }} |
| 92 | + if: ${{ env.run_lcov == 'TRUE' && always() && steps.stats.outputs.ncov_functions > env.allowed_ncov_functions }} |
93 | 93 | run: | |
94 | 94 | echo "::error::Too many uncovered functions (${{ steps.stats.outputs.ncov_functions }})" |
95 | 95 | /bin/false |
96 | 96 |
|
97 | 97 | - name: Enforce coverage line minimum |
98 | | - if: ${{ always() && steps.stats.outputs.ncov_lines > env.allowed_ncov_lines }} |
| 98 | + if: ${{ env.run_lcov == 'TRUE' && always() && steps.stats.outputs.ncov_lines > env.allowed_ncov_lines }} |
99 | 99 | run: | |
100 | 100 | echo "::error::Too many uncovered lines (${{ steps.stats.outputs.ncov_lines }})" |
101 | 101 | /bin/false |
102 | 102 |
|
103 | 103 | - name: Enforce coverage branch minimum |
104 | | - if: ${{ always() && steps.stats.outputs.ncov_branches > env.allowed_ncov_branches }} |
| 104 | + if: ${{ env.run_lcov == 'TRUE' && always() && steps.stats.outputs.ncov_branches > env.allowed_ncov_branches }} |
105 | 105 | run: | |
106 | 106 | echo "::error::Too many uncovered branches (${{ steps.stats.outputs.ncov_branches }})" |
107 | 107 | /bin/false |
108 | 108 |
|
| 109 | + - name: Enforce keeping coverage function minimum up-to-date |
| 110 | + if: ${{ env.run_lcov == 'TRUE' && always() && steps.stats.outputs.ncov_functions < env.allowed_ncov_functions }} |
| 111 | + run: | |
| 112 | + echo "::error::${{ steps.stats.outputs.ncov_functions }} uncovered function${{ steps.stats.outputs.ncov_functions == 1 && '' || 's' }} reported, but ${{ env.allowed_ncov_functions }} ${{ env.allowed_ncov_functions == 1 && 'is' || 'are' }} allowed." |
| 113 | + echo "::error::Please update the 'allowed_ncov_functions' variable to ${{ steps.stats.outputs.ncov_functions }} in order to match the new coverage level." |
| 114 | + /bin/false |
| 115 | +
|
| 116 | + - name: Enforce keeping coverage line minimum up-to-date |
| 117 | + if: ${{ env.run_lcov == 'TRUE' && always() && steps.stats.outputs.ncov_lines < env.allowed_ncov_lines }} |
| 118 | + run: | |
| 119 | + echo "::error::${{ steps.stats.outputs.ncov_lines }} uncovered line${{ steps.stats.outputs.ncov_lines == 1 && '' || 's' }} reported, but ${{ env.allowed_ncov_lines }} ${{ env.allowed_ncov_lines == 1 && 'is' || 'are' }} allowed." |
| 120 | + echo "::error::Please update the 'allowed_ncov_lines' variable to ${{ steps.stats.outputs.ncov_lines }} in order to match the new coverage level." |
| 121 | + /bin/false |
| 122 | +
|
| 123 | + - name: Enforce keeping coverage branch minimum up-to-date |
| 124 | + if: ${{ env.run_lcov == 'TRUE' && always() && steps.stats.outputs.ncov_branches < env.allowed_ncov_branches }} |
| 125 | + run: | |
| 126 | + echo "::error::${{ steps.stats.outputs.ncov_branches }} uncovered branch${{ steps.stats.outputs.ncov_branches == 1 && '' || 'es' }} reported, but ${{ env.allowed_ncov_branches }} ${{ env.allowed_ncov_branches == 1 && 'is' || 'are' }} allowed." |
| 127 | + echo "::error::Please update the 'allowed_ncov_branches' variable to ${{ steps.stats.outputs.ncov_branches }} in order to match the new coverage level." |
| 128 | + /bin/false |
| 129 | +
|
109 | 130 | - name: Assemble Results |
110 | 131 | if: ${{ always() }} |
111 | 132 | run: | |
|
0 commit comments