Skip to content

Commit 60eed33

Browse files
committed
Merge pull request #1419 from thnkslprpt:fix-1417-and-1418-coverage-workflow-bug-fix-and-enforce-updating
Fix #1417, Fix #1418, Fix workflow bug and enforce updating of coverage minimums
2 parents d6412df + d95c5f6 commit 60eed33

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

.github/workflows/standalone-build.yml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
path: source
3535

3636
- name: Install Coverage Analysis Tools
37-
if: ${{ matrix.build-type == 'Debug' && matrix.base-os == 'ubuntu-20.04' }}
37+
if: ${{ matrix.build-type == 'Debug' }}
3838
run: sudo apt-get install -y lcov xsltproc && echo "run_lcov=TRUE" >> $GITHUB_ENV
3939

4040
- name: Set up debug environment
@@ -89,23 +89,44 @@ jobs:
8989
binary-dir: build
9090

9191
- 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 }}
9393
run: |
9494
echo "::error::Too many uncovered functions (${{ steps.stats.outputs.ncov_functions }})"
9595
/bin/false
9696
9797
- 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 }}
9999
run: |
100100
echo "::error::Too many uncovered lines (${{ steps.stats.outputs.ncov_lines }})"
101101
/bin/false
102102
103103
- 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 }}
105105
run: |
106106
echo "::error::Too many uncovered branches (${{ steps.stats.outputs.ncov_branches }})"
107107
/bin/false
108108
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+
109130
- name: Assemble Results
110131
if: ${{ always() }}
111132
run: |

0 commit comments

Comments
 (0)