forked from eatvio/eatvio_app
feat(ci/cd): add coverage test
This commit is contained in:
@@ -140,7 +140,21 @@ jobs:
|
||||
run: flutter analyze
|
||||
|
||||
- name: Test
|
||||
run: flutter test
|
||||
run: flutter test --coverage
|
||||
|
||||
- name: Test coverage
|
||||
run: |
|
||||
awk -F: '
|
||||
/^LF:/ { total += $2 }
|
||||
/^LH:/ { covered += $2 }
|
||||
END {
|
||||
if (total == 0) {
|
||||
print "Coverage: 0%"
|
||||
} else {
|
||||
printf "Coverage: %.2f%%\n", (covered / total) * 100
|
||||
}
|
||||
}
|
||||
' coverage/lcov.info
|
||||
|
||||
- name: Build apk
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user