File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 2121 settings :
2222 runs-on : " ubuntu-latest"
2323 name : " Define workflow settings"
24+ outputs :
25+ minimum_coverage : " 100"
2426 steps :
2527 - name : " Repo checkout"
2628 uses : " actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"
@@ -104,12 +106,21 @@ jobs:
104106 - name : " Compile coverage data"
105107 run : " uvx nox --session combine"
106108
107- - name : " Post summary to step summary. "
109+ - name : " Post summary to step summary"
108110 run : |
109111 export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
110112 echo "TOTAL=$TOTAL" >> $GITHUB_ENV
111113 echo "### Total coverage: ${TOTAL}%" >> $GITHUB_STEP_SUMMARY
112114
115+ - name : " Enforce minimum coverage"
116+ env :
117+ MINIMUM_COVERAGE : ${{ setps.settings.outputs.minimum_coverage }}
118+ run : |
119+ echo "### Minimum coverage required: ${MINIMUM_COVERAGE}%" >> $GITHUB_STEP_SUMMARY
120+ if [ $MINIMUM_COVERAGE -gt $TOTAL ]; then
121+ exit 1
122+ fi
123+
113124 linters-and-formatters :
114125 name : " linters and formatters"
115126 needs : " settings"
Original file line number Diff line number Diff line change @@ -11,6 +11,11 @@ def main() -> bool:
1111 return True
1212
1313
14+ def no_covered () -> None :
15+ """"""
16+ return None
17+
18+
1419def squared (value : int ) -> int :
1520 """Returns the squared value"""
1621 return value * value
You can’t perform that action at this time.
0 commit comments