mirror of
https://github.com/home-assistant/core.git
synced 2025-06-24 17:11:53 +02:00
Upload test results to codecov (#138512)
* Upload test results to codecov * Upload tests results in single job
This commit is contained in:
53
.github/workflows/ci.yaml
vendored
53
.github/workflows/ci.yaml
vendored
@ -962,6 +962,7 @@ jobs:
|
|||||||
if [[ "${{ needs.info.outputs.skip_coverage }}" != "true" ]]; then
|
if [[ "${{ needs.info.outputs.skip_coverage }}" != "true" ]]; then
|
||||||
cov_params+=(--cov="homeassistant")
|
cov_params+=(--cov="homeassistant")
|
||||||
cov_params+=(--cov-report=xml)
|
cov_params+=(--cov-report=xml)
|
||||||
|
cov_params+=(--junitxml=junit.xml -o junit_family=legacy)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Test group ${{ matrix.group }}: $(sed -n "${{ matrix.group }},1p" pytest_buckets.txt)"
|
echo "Test group ${{ matrix.group }}: $(sed -n "${{ matrix.group }},1p" pytest_buckets.txt)"
|
||||||
@ -992,6 +993,12 @@ jobs:
|
|||||||
name: coverage-${{ matrix.python-version }}-${{ matrix.group }}
|
name: coverage-${{ matrix.python-version }}-${{ matrix.group }}
|
||||||
path: coverage.xml
|
path: coverage.xml
|
||||||
overwrite: true
|
overwrite: true
|
||||||
|
- name: Upload test results artifact
|
||||||
|
if: needs.info.outputs.skip_coverage != 'true'
|
||||||
|
uses: actions/upload-artifact@v4.6.0
|
||||||
|
with:
|
||||||
|
name: test-results-full-${{ matrix.python-version }}-${{ matrix.group }}
|
||||||
|
path: junit.xml
|
||||||
- name: Remove pytest_buckets
|
- name: Remove pytest_buckets
|
||||||
run: rm pytest_buckets.txt
|
run: rm pytest_buckets.txt
|
||||||
- name: Check dirty
|
- name: Check dirty
|
||||||
@ -1088,6 +1095,7 @@ jobs:
|
|||||||
cov_params+=(--cov="homeassistant.components.recorder")
|
cov_params+=(--cov="homeassistant.components.recorder")
|
||||||
cov_params+=(--cov-report=xml)
|
cov_params+=(--cov-report=xml)
|
||||||
cov_params+=(--cov-report=term-missing)
|
cov_params+=(--cov-report=term-missing)
|
||||||
|
cov_params+=(--junitxml=junit.xml -o junit_family=legacy)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
python3 -b -X dev -m pytest \
|
python3 -b -X dev -m pytest \
|
||||||
@ -1122,6 +1130,13 @@ jobs:
|
|||||||
steps.pytest-partial.outputs.mariadb }}
|
steps.pytest-partial.outputs.mariadb }}
|
||||||
path: coverage.xml
|
path: coverage.xml
|
||||||
overwrite: true
|
overwrite: true
|
||||||
|
- name: Upload test results artifact
|
||||||
|
if: needs.info.outputs.skip_coverage != 'true'
|
||||||
|
uses: actions/upload-artifact@v4.6.0
|
||||||
|
with:
|
||||||
|
name: test-results-mariadb-${{ matrix.python-version }}-${{
|
||||||
|
steps.pytest-partial.outputs.mariadb }}
|
||||||
|
path: junit.xml
|
||||||
- name: Check dirty
|
- name: Check dirty
|
||||||
run: |
|
run: |
|
||||||
./script/check_dirty
|
./script/check_dirty
|
||||||
@ -1218,6 +1233,7 @@ jobs:
|
|||||||
cov_params+=(--cov="homeassistant.components.recorder")
|
cov_params+=(--cov="homeassistant.components.recorder")
|
||||||
cov_params+=(--cov-report=xml)
|
cov_params+=(--cov-report=xml)
|
||||||
cov_params+=(--cov-report=term-missing)
|
cov_params+=(--cov-report=term-missing)
|
||||||
|
cov_params+=(--junitxml=junit.xml -o junit_family=legacy)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
python3 -b -X dev -m pytest \
|
python3 -b -X dev -m pytest \
|
||||||
@ -1253,6 +1269,13 @@ jobs:
|
|||||||
steps.pytest-partial.outputs.postgresql }}
|
steps.pytest-partial.outputs.postgresql }}
|
||||||
path: coverage.xml
|
path: coverage.xml
|
||||||
overwrite: true
|
overwrite: true
|
||||||
|
- name: Upload test results artifact
|
||||||
|
if: needs.info.outputs.skip_coverage != 'true'
|
||||||
|
uses: actions/upload-artifact@v4.6.0
|
||||||
|
with:
|
||||||
|
name: test-results-postgres-${{ matrix.python-version }}-${{
|
||||||
|
steps.pytest-partial.outputs.postgresql }}
|
||||||
|
path: junit.xml
|
||||||
- name: Check dirty
|
- name: Check dirty
|
||||||
run: |
|
run: |
|
||||||
./script/check_dirty
|
./script/check_dirty
|
||||||
@ -1365,6 +1388,7 @@ jobs:
|
|||||||
cov_params+=(--cov="homeassistant.components.${{ matrix.group }}")
|
cov_params+=(--cov="homeassistant.components.${{ matrix.group }}")
|
||||||
cov_params+=(--cov-report=xml)
|
cov_params+=(--cov-report=xml)
|
||||||
cov_params+=(--cov-report=term-missing)
|
cov_params+=(--cov-report=term-missing)
|
||||||
|
cov_params+=(--junitxml=junit.xml -o junit_family=legacy)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
python3 -b -X dev -m pytest \
|
python3 -b -X dev -m pytest \
|
||||||
@ -1394,6 +1418,12 @@ jobs:
|
|||||||
name: coverage-${{ matrix.python-version }}-${{ matrix.group }}
|
name: coverage-${{ matrix.python-version }}-${{ matrix.group }}
|
||||||
path: coverage.xml
|
path: coverage.xml
|
||||||
overwrite: true
|
overwrite: true
|
||||||
|
- name: Upload test results artifact
|
||||||
|
if: needs.info.outputs.skip_coverage != 'true'
|
||||||
|
uses: actions/upload-artifact@v4.6.0
|
||||||
|
with:
|
||||||
|
name: test-results-partial-${{ matrix.python-version }}-${{ matrix.group }}
|
||||||
|
path: junit.xml
|
||||||
- name: Check dirty
|
- name: Check dirty
|
||||||
run: |
|
run: |
|
||||||
./script/check_dirty
|
./script/check_dirty
|
||||||
@ -1419,3 +1449,26 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fail_ci_if_error: true
|
fail_ci_if_error: true
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|
||||||
|
upload-test-results:
|
||||||
|
name: Upload test results to Codecov
|
||||||
|
if: needs.info.outputs.skip_coverage != 'true' && !cancelled()
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
needs:
|
||||||
|
- info
|
||||||
|
- pytest-partial
|
||||||
|
- pytest-full
|
||||||
|
- pytest-postgres
|
||||||
|
- pytest-mariadb
|
||||||
|
timeout-minutes: 10
|
||||||
|
steps:
|
||||||
|
- name: Download all coverage artifacts
|
||||||
|
uses: actions/download-artifact@v4.1.8
|
||||||
|
with:
|
||||||
|
pattern: test-results-*
|
||||||
|
- name: Upload test results to Codecov
|
||||||
|
uses: codecov/test-results-action@v1
|
||||||
|
with:
|
||||||
|
fail_ci_if_error: true
|
||||||
|
verbose: true
|
||||||
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -69,6 +69,7 @@ test-reports/
|
|||||||
test-results.xml
|
test-results.xml
|
||||||
test-output.xml
|
test-output.xml
|
||||||
pytest-*.txt
|
pytest-*.txt
|
||||||
|
junit.xml
|
||||||
|
|
||||||
# Translations
|
# Translations
|
||||||
*.mo
|
*.mo
|
||||||
|
Reference in New Issue
Block a user