@@ -79,19 +79,19 @@ jobs:
79
79
run : |
80
80
python manage.py makemigrations --check
81
81
82
- - name : Ensure previous Python coverage data is erased
83
- run : |
84
- coverage erase
82
+ # - name: Ensure previous Python coverage data is erased
83
+ # run: |
84
+ # coverage erase
85
85
86
- - name : Run Python unit tests
87
- run : |
88
- python -W default::DeprecationWarning -m coverage run manage.py test tests --settings="tests.test_settings"
86
+ # - name: Run Python unit tests
87
+ # run: |
88
+ # python -W default::DeprecationWarning -m coverage run manage.py test tests --settings="tests.test_settings"
89
89
90
- - name : Generate Python report coverage
91
- run : |
92
- coverage report
93
- coverage json
94
- mv coverage/python/coverage.json feature_branch_python_coverage.json
90
+ # - name: Generate Python report coverage
91
+ # run: |
92
+ # coverage report
93
+ # coverage json
94
+ # mv coverage/python/coverage.json feature_branch_python_coverage.json
95
95
96
96
- name : Upload frontend coverage report as artifact
97
97
uses : actions/upload-artifact@v4
@@ -100,12 +100,12 @@ jobs:
100
100
path : feature_branch_frontend_coverage.xml
101
101
overwrite : true
102
102
103
- - name : Upload Python coverage report as artifact
104
- uses : actions/upload-artifact@v4
105
- with :
106
- name : feature-branch-python-coverage-report
107
- path : feature_branch_python_coverage.json
108
- overwrite : true
103
+ # - name: Upload Python coverage report as artifact
104
+ # uses: actions/upload-artifact@v4
105
+ # with:
106
+ # name: feature-branch-python-coverage-report
107
+ # path: feature_branch_python_coverage.json
108
+ # overwrite: true
109
109
110
110
build_target_branch :
111
111
runs-on : ubuntu-latest
@@ -187,25 +187,25 @@ jobs:
187
187
run : |
188
188
python manage.py makemigrations --check
189
189
190
- - name : Ensure previous Python coverage data is erased
191
- run : |
192
- coverage erase
190
+ # - name: Ensure previous Python coverage data is erased
191
+ # run: |
192
+ # coverage erase
193
193
194
- - name : Run Python unit tests
195
- run : |
196
- python -W default::DeprecationWarning -m coverage run manage.py test tests --settings="tests.test_settings"
194
+ # - name: Run Python unit tests
195
+ # run: |
196
+ # python -W default::DeprecationWarning -m coverage run manage.py test tests --settings="tests.test_settings"
197
197
198
- - name : Generate Python report coverage
199
- run : |
200
- coverage report
201
- coverage json
198
+ # - name: Generate Python report coverage
199
+ # run: |
200
+ # coverage report
201
+ # coverage json
202
202
203
- # handles older target branch
204
- if [ -f coverage/python/coverage.json ]; then
205
- mv coverage/python/coverage.json target_branch_python_coverage.json
206
- else
207
- mv coverage.json target_branch_python_coverage.json
208
- fi
203
+ # # handles older target branch
204
+ # if [ -f coverage/python/coverage.json ]; then
205
+ # mv coverage/python/coverage.json target_branch_python_coverage.json
206
+ # else
207
+ # mv coverage.json target_branch_python_coverage.json
208
+ # fi
209
209
210
210
- name : Upload frontend coverage report as artifact
211
211
uses : actions/upload-artifact@v4
@@ -214,14 +214,14 @@ jobs:
214
214
path : target_branch_frontend_coverage.xml
215
215
overwrite : true
216
216
217
- - name : Upload Python coverage report as artifact
218
- uses : actions/upload-artifact@v4
219
- with :
220
- name : target-branch-python-coverage-report
221
- path : target_branch_python_coverage.json
222
- overwrite : true
217
+ # - name: Upload Python coverage report as artifact
218
+ # uses: actions/upload-artifact@v4
219
+ # with:
220
+ # name: target-branch-python-coverage-report
221
+ # path: target_branch_python_coverage.json
222
+ # overwrite: true
223
223
224
- check_coverage :
224
+ check_frontend_coverage :
225
225
runs-on : ubuntu-latest
226
226
needs : [build_feature_branch, build_target_branch]
227
227
steps :
@@ -285,6 +285,8 @@ jobs:
285
285
$feature_branch_frontend_coverage = $totalCoverage / $nonZeroCount
286
286
}
287
287
288
+ echo "FOO: $feature_branch_frontend_coverage"
289
+
288
290
echo "feature_branch_frontend_coverage=$feature_branch_frontend_coverage" >> $GITHUB_ENV
289
291
290
292
- name : Download target branch frontend coverage report artifact
@@ -355,39 +357,54 @@ jobs:
355
357
- name : Compare frontend feature coverage with target coverage
356
358
if : github.event_name == 'pull_request'
357
359
run : |
358
- feature_branch_frontend_coverage="${feature_branch_frontend_coverage:-0.0}"
359
- target_branch_frontend_coverage="${target_branch_frontend_coverage:-0.0}"
360
-
361
- # Compare feature coverage with target coverage using floating-point comparison
362
- if awk -v feature="$feature_branch_frontend_coverage" -v target="$target_branch_frontend_coverage" 'BEGIN { exit (feature < target) ? 0 : 1 }'; then
363
- echo "Coverage decreased from $target_branch_frontend_coverage% to $feature_branch_frontend_coverage%. Please add or update tests to increase coverage."
364
- exit 1
365
- else
366
- echo "Feature branch coverage ($feature_branch_frontend_coverage%) >= Target branch coverage ($target_branch_frontend_coverage%)."
367
- fi
368
-
369
- - name : Download feature branch Python coverage report artifact
370
- uses : actions/download-artifact@v4
371
- with :
372
- name : feature-branch-python-coverage-report
373
- path : .
374
-
375
- - name : Download target branch Python coverage report artifact
376
- uses : actions/download-artifact@v4
377
- with :
378
- name : target-branch-python-coverage-report
379
- path : .
380
-
381
- - name : Compare Python feature coverage with target coverage
382
- if : github.event_name == 'pull_request'
383
- run : |
384
- feature_branch_python_coverage=$(cat feature_branch_python_coverage.json | grep -o '"totals": {[^}]*' | grep -o '"percent_covered": [0-9.]*' | awk -F ': ' '{print $2}')
385
- target_branch_python_coverage=$(cat target_branch_python_coverage.json | grep -o '"totals": {[^}]*' | grep -o '"percent_covered": [0-9.]*' | awk -F ': ' '{print $2}')
386
-
387
- # Compare feature coverage with target coverage using floating-point comparison
388
- if awk -v feature="$feature_branch_python_coverage" -v target="$target_branch_python_coverage" 'BEGIN { exit (feature < target) ? 0 : 1 }'; then
389
- echo "Coverage decreased from $target_branch_python_coverage% to $feature_branch_python_coverage%. Please add or update tests to increase coverage."
390
- exit 1
391
- else
392
- echo "Feature branch coverage ($feature_branch_python_coverage%) >= Target branch coverage ($target_branch_python_coverage%)."
393
- fi
360
+ feature_branch_frontend_coverage=${{ env.feature_branch_frontend_coverage }}
361
+
362
+ echo "Feature branch coverage: $feature_branch_frontend_coverage"
363
+
364
+ # target_branch_frontend_coverage=$(echo "${{env.target_branch_frontend_coverage:-0.0}}" )
365
+
366
+ # # Compare feature coverage with target coverage using floating-point comparison
367
+ # if awk -v feature="$feature_branch_frontend_coverage" -v target="$target_branch_frontend_coverage" 'BEGIN { exit (feature < target) ? 0 : 1 }'; then
368
+ # echo "Coverage decreased from $target_branch_frontend_coverage% to $feature_branch_frontend_coverage%. Please add or update tests to increase coverage."
369
+ # exit 1
370
+ # else
371
+ # echo "Feature branch coverage ($feature_branch_frontend_coverage%) >= Target branch coverage ($target_branch_frontend_coverage%)."
372
+ # fi
373
+
374
+ # check_python_coverage:
375
+ # runs-on: ubuntu-latest
376
+ # needs: [build_feature_branch, build_target_branch]
377
+ # steps:
378
+ # - uses: actions/checkout@v4
379
+
380
+ # - name: Set up Python
381
+ # uses: actions/setup-python@v5
382
+ # with:
383
+ # python-version: '3.x' # Use the latest available version
384
+ # check-latest: true
385
+
386
+ # - name: Download feature branch Python coverage report artifact
387
+ # uses: actions/download-artifact@v4
388
+ # with:
389
+ # name: feature-branch-python-coverage-report
390
+ # path: .
391
+
392
+ # - name: Download target branch Python coverage report artifact
393
+ # uses: actions/download-artifact@v4
394
+ # with:
395
+ # name: target-branch-python-coverage-report
396
+ # path: .
397
+
398
+ # - name: Compare Python feature coverage with target coverage
399
+ # if: github.event_name == 'pull_request'
400
+ # run: |
401
+ # feature_branch_python_coverage=$(cat feature_branch_python_coverage.json | grep -o '"totals": {[^}]*' | grep -o '"percent_covered": [0-9.]*' | awk -F ': ' '{print $2}')
402
+ # target_branch_python_coverage=$(cat target_branch_python_coverage.json | grep -o '"totals": {[^}]*' | grep -o '"percent_covered": [0-9.]*' | awk -F ': ' '{print $2}')
403
+
404
+ # # Compare feature coverage with target coverage using floating-point comparison
405
+ # if awk -v feature="$feature_branch_python_coverage" -v target="$target_branch_python_coverage" 'BEGIN { exit (feature < target) ? 0 : 1 }'; then
406
+ # echo "Coverage decreased from $target_branch_python_coverage% to $feature_branch_python_coverage%. Please add or update tests to increase coverage."
407
+ # exit 1
408
+ # else
409
+ # echo "Feature branch coverage ($feature_branch_python_coverage%) >= Target branch coverage ($target_branch_python_coverage%)."
410
+ # fi
0 commit comments