Skip to content

Commit e746715

Browse files
committed
Enhance coverage verification and docstring checks in CI workflow
1 parent bcb67ca commit e746715

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

.github/workflows/test-sdk-examples.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@ jobs:
4343
run: |
4444
pytest tests/ -v --cov=. --cov-report=term-missing --cov-report=xml --cov-report=html
4545
46-
- name: Upload coverage to Codecov
47-
uses: codecov/codecov-action@v3
48-
with:
49-
files: ./sdk-examples/coverage.xml
50-
flags: sdk-examples
51-
name: sdk-examples-python-3.10
52-
fail_ci_if_error: false
46+
- name: Verify coverage data exists
47+
working-directory: sdk-examples
48+
run: |
49+
if [ ! -f .coverage ]; then
50+
echo "Error: No coverage data found. Coverage was not collected."
51+
exit 1
52+
fi
53+
echo "Coverage data verified at .coverage"
5354
5455
- name: Coverage comment
5556
uses: py-cov-action/python-coverage-comment-action@v3
@@ -60,6 +61,7 @@ jobs:
6061
MINIMUM_ORANGE: 90
6162
ANNOTATE_MISSING_LINES: true
6263
ANNOTATION_TYPE: warning
64+
COVERAGE_PATH: sdk-examples
6365

6466
- name: Generate coverage report
6567
if: always()
@@ -123,9 +125,9 @@ jobs:
123125
124126
- name: Check for common issues
125127
run: |
126-
# Check all files have proper headers
128+
# Check all files have proper docstrings (skip shebangs and encoding declarations)
127129
for file in sdk-examples/*.py; do
128-
if ! head -n 1 "$file" | grep -q '"""'; then
130+
if ! head -n 20 "$file" | grep -E '^("""|'"'"''"'"''"'"')' > /dev/null; then
129131
echo "Missing docstring in $file"
130132
exit 1
131133
fi

0 commit comments

Comments
 (0)