mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 13:57:10 +00:00
Add input option to skip coverage [ci] (#98821)
This commit is contained in:
parent
daade26466
commit
3f2c03fe77
57
.github/workflows/ci.yaml
vendored
57
.github/workflows/ci.yaml
vendored
@ -19,6 +19,10 @@ on:
|
|||||||
description: "Skip pytest"
|
description: "Skip pytest"
|
||||||
default: false
|
default: false
|
||||||
type: boolean
|
type: boolean
|
||||||
|
skip-coverage:
|
||||||
|
description: "Skip coverage"
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
pylint-only:
|
pylint-only:
|
||||||
description: "Only run pylint"
|
description: "Only run pylint"
|
||||||
default: false
|
default: false
|
||||||
@ -79,6 +83,7 @@ jobs:
|
|||||||
test_groups: ${{ steps.info.outputs.test_groups }}
|
test_groups: ${{ steps.info.outputs.test_groups }}
|
||||||
tests_glob: ${{ steps.info.outputs.tests_glob }}
|
tests_glob: ${{ steps.info.outputs.tests_glob }}
|
||||||
tests: ${{ steps.info.outputs.tests }}
|
tests: ${{ steps.info.outputs.tests }}
|
||||||
|
skip_coverage: ${{ steps.info.outputs.skip_coverage }}
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
@ -127,6 +132,7 @@ jobs:
|
|||||||
test_group_count=10
|
test_group_count=10
|
||||||
tests="[]"
|
tests="[]"
|
||||||
tests_glob=""
|
tests_glob=""
|
||||||
|
skip_coverage=""
|
||||||
|
|
||||||
if [[ "${{ steps.integrations.outputs.changes }}" != "[]" ]];
|
if [[ "${{ steps.integrations.outputs.changes }}" != "[]" ]];
|
||||||
then
|
then
|
||||||
@ -176,6 +182,12 @@ jobs:
|
|||||||
test_full_suite="true"
|
test_full_suite="true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "${{ github.event.inputs.skip-coverage }}" == "true" ]] \
|
||||||
|
|| [[ "${{ contains(github.event.pull_request.labels.*.name, 'ci-skip-coverage') }}" == "true" ]];
|
||||||
|
then
|
||||||
|
skip_coverage="true"
|
||||||
|
fi
|
||||||
|
|
||||||
# Output & sent to GitHub Actions
|
# Output & sent to GitHub Actions
|
||||||
echo "mariadb_groups: ${mariadb_groups}"
|
echo "mariadb_groups: ${mariadb_groups}"
|
||||||
echo "mariadb_groups=${mariadb_groups}" >> $GITHUB_OUTPUT
|
echo "mariadb_groups=${mariadb_groups}" >> $GITHUB_OUTPUT
|
||||||
@ -195,6 +207,8 @@ jobs:
|
|||||||
echo "tests=${tests}" >> $GITHUB_OUTPUT
|
echo "tests=${tests}" >> $GITHUB_OUTPUT
|
||||||
echo "tests_glob: ${tests_glob}"
|
echo "tests_glob: ${tests_glob}"
|
||||||
echo "tests_glob=${tests_glob}" >> $GITHUB_OUTPUT
|
echo "tests_glob=${tests_glob}" >> $GITHUB_OUTPUT
|
||||||
|
echo "skip_coverage: ${skip_coverage}"
|
||||||
|
echo "skip_coverage=${skip_coverage}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
pre-commit:
|
pre-commit:
|
||||||
name: Prepare pre-commit base
|
name: Prepare pre-commit base
|
||||||
@ -741,6 +755,11 @@ jobs:
|
|||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
python --version
|
python --version
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
cov_params=()
|
||||||
|
if [[ "${{ needs.info.outputs.skip_coverage }}" != "true" ]]; then
|
||||||
|
cov_params+=(--cov="homeassistant")
|
||||||
|
cov_params+=(--cov-report=xml)
|
||||||
|
fi
|
||||||
|
|
||||||
python3 -X dev -m pytest \
|
python3 -X dev -m pytest \
|
||||||
-qq \
|
-qq \
|
||||||
@ -750,8 +769,7 @@ jobs:
|
|||||||
--dist=loadfile \
|
--dist=loadfile \
|
||||||
--test-group-count ${{ needs.info.outputs.test_group_count }} \
|
--test-group-count ${{ needs.info.outputs.test_group_count }} \
|
||||||
--test-group=${{ matrix.group }} \
|
--test-group=${{ matrix.group }} \
|
||||||
--cov="homeassistant" \
|
${cov_params[@]} \
|
||||||
--cov-report=xml \
|
|
||||||
-o console_output_style=count \
|
-o console_output_style=count \
|
||||||
-p no:sugar \
|
-p no:sugar \
|
||||||
tests \
|
tests \
|
||||||
@ -773,13 +791,18 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
cov_params=()
|
||||||
|
if [[ "${{ needs.info.outputs.skip_coverage }}" != "true" ]]; then
|
||||||
|
cov_params+=(--cov="homeassistant.components.${{ matrix.group }}")
|
||||||
|
cov_params+=(--cov-report=xml)
|
||||||
|
cov_params+=(--cov-report=term-missing)
|
||||||
|
fi
|
||||||
|
|
||||||
python3 -X dev -m pytest \
|
python3 -X dev -m pytest \
|
||||||
-qq \
|
-qq \
|
||||||
--timeout=9 \
|
--timeout=9 \
|
||||||
-n auto \
|
-n auto \
|
||||||
--cov="homeassistant.components.${{ matrix.group }}" \
|
${cov_params[@]} \
|
||||||
--cov-report=xml \
|
|
||||||
--cov-report=term-missing \
|
|
||||||
-o console_output_style=count \
|
-o console_output_style=count \
|
||||||
--durations=0 \
|
--durations=0 \
|
||||||
--durations-min=1 \
|
--durations-min=1 \
|
||||||
@ -793,6 +816,7 @@ jobs:
|
|||||||
name: pytest-${{ github.run_number }}
|
name: pytest-${{ github.run_number }}
|
||||||
path: pytest-*.txt
|
path: pytest-*.txt
|
||||||
- name: Upload coverage artifact
|
- name: Upload coverage artifact
|
||||||
|
if: needs.info.outputs.skip_coverage != 'true'
|
||||||
uses: actions/upload-artifact@v3.1.2
|
uses: actions/upload-artifact@v3.1.2
|
||||||
with:
|
with:
|
||||||
name: coverage-${{ matrix.python-version }}-${{ matrix.group }}
|
name: coverage-${{ matrix.python-version }}-${{ matrix.group }}
|
||||||
@ -888,14 +912,18 @@ jobs:
|
|||||||
python --version
|
python --version
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
mariadb=$(echo "${{ matrix.mariadb-group }}" | sed "s/:/-/g")
|
mariadb=$(echo "${{ matrix.mariadb-group }}" | sed "s/:/-/g")
|
||||||
|
cov_params=()
|
||||||
|
if [[ "${{ needs.info.outputs.skip_coverage }}" != "true" ]]; then
|
||||||
|
cov_params+=(--cov="homeassistant.components.recorder")
|
||||||
|
cov_params+=(--cov-report=xml)
|
||||||
|
cov_params+=(--cov-report=term-missing)
|
||||||
|
fi
|
||||||
|
|
||||||
python3 -X dev -m pytest \
|
python3 -X dev -m pytest \
|
||||||
-qq \
|
-qq \
|
||||||
--timeout=20 \
|
--timeout=20 \
|
||||||
-n 1 \
|
-n 1 \
|
||||||
--cov="homeassistant.components.recorder" \
|
${cov_params[@]} \
|
||||||
--cov-report=xml \
|
|
||||||
--cov-report=term-missing \
|
|
||||||
-o console_output_style=count \
|
-o console_output_style=count \
|
||||||
--durations=10 \
|
--durations=10 \
|
||||||
-p no:sugar \
|
-p no:sugar \
|
||||||
@ -912,6 +940,7 @@ jobs:
|
|||||||
name: pytest-${{ github.run_number }}
|
name: pytest-${{ github.run_number }}
|
||||||
path: pytest-*.txt
|
path: pytest-*.txt
|
||||||
- name: Upload coverage artifact
|
- name: Upload coverage artifact
|
||||||
|
if: needs.info.outputs.skip_coverage != 'true'
|
||||||
uses: actions/upload-artifact@v3.1.2
|
uses: actions/upload-artifact@v3.1.2
|
||||||
with:
|
with:
|
||||||
name: coverage-${{ matrix.python-version }}-mariadb
|
name: coverage-${{ matrix.python-version }}-mariadb
|
||||||
@ -1007,14 +1036,18 @@ jobs:
|
|||||||
python --version
|
python --version
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
postgresql=$(echo "${{ matrix.postgresql-group }}" | sed "s/:/-/g")
|
postgresql=$(echo "${{ matrix.postgresql-group }}" | sed "s/:/-/g")
|
||||||
|
cov_params=()
|
||||||
|
if [[ "${{ needs.info.outputs.skip_coverage }}" != "true" ]]; then
|
||||||
|
cov_params+=(--cov="homeassistant.components.recorder")
|
||||||
|
cov_params+=(--cov-report=xml)
|
||||||
|
cov_params+=(--cov-report=term-missing)
|
||||||
|
fi
|
||||||
|
|
||||||
python3 -X dev -m pytest \
|
python3 -X dev -m pytest \
|
||||||
-qq \
|
-qq \
|
||||||
--timeout=9 \
|
--timeout=9 \
|
||||||
-n 1 \
|
-n 1 \
|
||||||
--cov="homeassistant.components.recorder" \
|
${cov_params[@]} \
|
||||||
--cov-report=xml \
|
|
||||||
--cov-report=term-missing \
|
|
||||||
-o console_output_style=count \
|
-o console_output_style=count \
|
||||||
--durations=0 \
|
--durations=0 \
|
||||||
--durations-min=10 \
|
--durations-min=10 \
|
||||||
@ -1032,6 +1065,7 @@ jobs:
|
|||||||
name: pytest-${{ github.run_number }}
|
name: pytest-${{ github.run_number }}
|
||||||
path: pytest-*.txt
|
path: pytest-*.txt
|
||||||
- name: Upload coverage artifact
|
- name: Upload coverage artifact
|
||||||
|
if: needs.info.outputs.skip_coverage != 'true'
|
||||||
uses: actions/upload-artifact@v3.1.0
|
uses: actions/upload-artifact@v3.1.0
|
||||||
with:
|
with:
|
||||||
name: coverage-${{ matrix.python-version }}-postgresql
|
name: coverage-${{ matrix.python-version }}-postgresql
|
||||||
@ -1042,6 +1076,7 @@ jobs:
|
|||||||
|
|
||||||
coverage:
|
coverage:
|
||||||
name: Upload test coverage to Codecov
|
name: Upload test coverage to Codecov
|
||||||
|
if: needs.info.outputs.skip_coverage != 'true'
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
needs:
|
needs:
|
||||||
- info
|
- info
|
||||||
|
Loading…
x
Reference in New Issue
Block a user