forked from home-assistant/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2,390 changed files
with
69,670 additions
and
52,053 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,7 @@ jobs: | |
run: find ./homeassistant/components/*/translations -name "*.json" | tar zcvf translations.tar.gz -T - | ||
|
||
- name: Upload translations | ||
uses: actions/[email protected].4 | ||
uses: actions/[email protected].6 | ||
with: | ||
name: translations | ||
path: translations.tar.gz | ||
|
@@ -197,7 +197,7 @@ jobs: | |
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build base image | ||
uses: home-assistant/builder@2024.03.5 | ||
uses: home-assistant/builder@2024.08.2 | ||
with: | ||
args: | | ||
$BUILD_ARGS \ | ||
|
@@ -263,7 +263,7 @@ jobs: | |
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build base image | ||
uses: home-assistant/builder@2024.03.5 | ||
uses: home-assistant/builder@2024.08.2 | ||
with: | ||
args: | | ||
$BUILD_ARGS \ | ||
|
@@ -323,7 +323,7 @@ jobs: | |
uses: actions/[email protected] | ||
|
||
- name: Install Cosign | ||
uses: sigstore/cosign-installer@v3.5.0 | ||
uses: sigstore/cosign-installer@v3.6.0 | ||
with: | ||
cosign-release: "v2.2.3" | ||
|
||
|
@@ -482,3 +482,56 @@ jobs: | |
export TWINE_PASSWORD="${{ secrets.TWINE_TOKEN }}" | ||
twine upload dist/* --skip-existing | ||
hassfest-image: | ||
name: Build and test hassfest image | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
attestations: write | ||
id-token: write | ||
needs: ["init"] | ||
if: github.repository_owner == 'home-assistant' | ||
env: | ||
HASSFEST_IMAGE_NAME: ghcr.io/home-assistant/hassfest | ||
HASSFEST_IMAGE_TAG: ghcr.io/home-assistant/hassfest:${{ needs.init.outputs.version }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build Docker image | ||
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0 | ||
with: | ||
context: . # So action will not pull the repository again | ||
file: ./script/hassfest/docker/Dockerfile | ||
load: true | ||
tags: ${{ env.HASSFEST_IMAGE_TAG }} | ||
|
||
- name: Run hassfest against core | ||
run: docker run --rm -v ${{ github.workspace }}/homeassistant:/github/workspace/homeassistant ${{ env.HASSFEST_IMAGE_TAG }} --core-integrations-path=/github/workspace/homeassistant/components | ||
|
||
- name: Push Docker image | ||
if: needs.init.outputs.channel != 'dev' && needs.init.outputs.publish == 'true' | ||
id: push | ||
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0 | ||
with: | ||
context: . # So action will not pull the repository again | ||
file: ./script/hassfest/docker/Dockerfile | ||
push: true | ||
tags: ${{ env.HASSFEST_IMAGE_TAG }},${{ env.HASSFEST_IMAGE_NAME }}:latest | ||
|
||
- name: Generate artifact attestation | ||
if: needs.init.outputs.channel != 'dev' && needs.init.outputs.publish == 'true' | ||
uses: actions/attest-build-provenance@6149ea5740be74af77f260b9db67e633f6b0a9a1 # v1.4.2 | ||
with: | ||
subject-name: ${{ env.HASSFEST_IMAGE_NAME }} | ||
subject-digest: ${{ steps.push.outputs.digest }} | ||
push-to-registry: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,12 +31,16 @@ on: | |
description: "Only run mypy" | ||
default: false | ||
type: boolean | ||
audit-licenses-only: | ||
description: "Only run audit licenses" | ||
default: false | ||
type: boolean | ||
|
||
env: | ||
CACHE_VERSION: 9 | ||
CACHE_VERSION: 10 | ||
UV_CACHE_VERSION: 1 | ||
MYPY_CACHE_VERSION: 8 | ||
HA_SHORT_VERSION: "2024.8" | ||
HA_SHORT_VERSION: "2024.9" | ||
DEFAULT_PYTHON: "3.12" | ||
ALL_PYTHON_VERSIONS: "['3.12']" | ||
# 10.3 is the oldest supported version | ||
|
@@ -222,6 +226,7 @@ jobs: | |
if: | | ||
github.event.inputs.pylint-only != 'true' | ||
&& github.event.inputs.mypy-only != 'true' | ||
&& github.event.inputs.audit-licenses-only != 'true' | ||
needs: | ||
- info | ||
steps: | ||
|
@@ -343,6 +348,7 @@ jobs: | |
pre-commit run --hook-stage manual ruff --all-files --show-diff-on-failure | ||
env: | ||
RUFF_OUTPUT_FORMAT: github | ||
|
||
lint-other: | ||
name: Check other linters | ||
runs-on: ubuntu-24.04 | ||
|
@@ -508,8 +514,7 @@ jobs: | |
uv pip install -U "pip>=21.3.1" setuptools wheel | ||
uv pip install -r requirements.txt | ||
python -m script.gen_requirements_all ci | ||
uv pip install -r requirements_all_pytest.txt | ||
uv pip install -r requirements_test.txt | ||
uv pip install -r requirements_all_pytest.txt -r requirements_test.txt | ||
uv pip install -e . --config-settings editable_mode=compat | ||
hassfest: | ||
|
@@ -518,6 +523,7 @@ jobs: | |
if: | | ||
github.event.inputs.pylint-only != 'true' | ||
&& github.event.inputs.mypy-only != 'true' | ||
&& github.event.inputs.audit-licenses-only != 'true' | ||
needs: | ||
- info | ||
- base | ||
|
@@ -556,6 +562,7 @@ jobs: | |
if: | | ||
github.event.inputs.pylint-only != 'true' | ||
&& github.event.inputs.mypy-only != 'true' | ||
&& github.event.inputs.audit-licenses-only != 'true' | ||
needs: | ||
- info | ||
- base | ||
|
@@ -589,7 +596,10 @@ jobs: | |
- info | ||
- base | ||
if: | | ||
needs.info.outputs.requirements == 'true' | ||
(github.event.inputs.pylint-only != 'true' | ||
&& github.event.inputs.mypy-only != 'true' | ||
|| github.event.inputs.audit-licenses-only == 'true') | ||
&& needs.info.outputs.requirements == 'true' | ||
steps: | ||
- name: Check out code from GitHub | ||
uses: actions/[email protected] | ||
|
@@ -613,7 +623,7 @@ jobs: | |
. venv/bin/activate | ||
pip-licenses --format=json --output-file=licenses.json | ||
- name: Upload licenses | ||
uses: actions/[email protected].4 | ||
uses: actions/[email protected].6 | ||
with: | ||
name: licenses | ||
path: licenses.json | ||
|
@@ -628,6 +638,7 @@ jobs: | |
timeout-minutes: 20 | ||
if: | | ||
github.event.inputs.mypy-only != 'true' | ||
&& github.event.inputs.audit-licenses-only != 'true' | ||
|| github.event.inputs.pylint-only == 'true' | ||
needs: | ||
- info | ||
|
@@ -672,7 +683,9 @@ jobs: | |
runs-on: ubuntu-24.04 | ||
timeout-minutes: 20 | ||
if: | | ||
(github.event.inputs.mypy-only != 'true' || github.event.inputs.pylint-only == 'true') | ||
(github.event.inputs.mypy-only != 'true' | ||
&& github.event.inputs.audit-licenses-only != 'true' | ||
|| github.event.inputs.pylint-only == 'true') | ||
&& (needs.info.outputs.tests_glob || needs.info.outputs.test_full_suite == 'true') | ||
needs: | ||
- info | ||
|
@@ -703,20 +716,21 @@ jobs: | |
run: | | ||
. venv/bin/activate | ||
python --version | ||
pylint --ignore-missing-annotations=y tests | ||
pylint tests | ||
- name: Run pylint (partially) | ||
if: needs.info.outputs.test_full_suite == 'false' | ||
shell: bash | ||
run: | | ||
. venv/bin/activate | ||
python --version | ||
pylint --ignore-missing-annotations=y tests/components/${{ needs.info.outputs.tests_glob }} | ||
pylint tests/components/${{ needs.info.outputs.tests_glob }} | ||
mypy: | ||
name: Check mypy | ||
runs-on: ubuntu-24.04 | ||
if: | | ||
github.event.inputs.pylint-only != 'true' | ||
&& github.event.inputs.audit-licenses-only != 'true' | ||
|| github.event.inputs.mypy-only == 'true' | ||
needs: | ||
- info | ||
|
@@ -781,6 +795,7 @@ jobs: | |
&& github.event.inputs.lint-only != 'true' | ||
&& github.event.inputs.pylint-only != 'true' | ||
&& github.event.inputs.mypy-only != 'true' | ||
&& github.event.inputs.audit-licenses-only != 'true' | ||
&& needs.info.outputs.test_full_suite == 'true' | ||
needs: | ||
- info | ||
|
@@ -818,7 +833,7 @@ jobs: | |
. venv/bin/activate | ||
python -m script.split_tests ${{ needs.info.outputs.test_group_count }} tests | ||
- name: Upload pytest_buckets | ||
uses: actions/[email protected].4 | ||
uses: actions/[email protected].6 | ||
with: | ||
name: pytest_buckets | ||
path: pytest_buckets.txt | ||
|
@@ -831,6 +846,7 @@ jobs: | |
&& github.event.inputs.lint-only != 'true' | ||
&& github.event.inputs.pylint-only != 'true' | ||
&& github.event.inputs.mypy-only != 'true' | ||
&& github.event.inputs.audit-licenses-only != 'true' | ||
&& needs.info.outputs.test_full_suite == 'true' | ||
needs: | ||
- info | ||
|
@@ -918,14 +934,14 @@ jobs: | |
2>&1 | tee pytest-${{ matrix.python-version }}-${{ matrix.group }}.txt | ||
- name: Upload pytest output | ||
if: success() || failure() && steps.pytest-full.conclusion == 'failure' | ||
uses: actions/[email protected].4 | ||
uses: actions/[email protected].6 | ||
with: | ||
name: pytest-${{ github.run_number }}-${{ matrix.python-version }}-${{ matrix.group }} | ||
path: pytest-*.txt | ||
overwrite: true | ||
- name: Upload coverage artifact | ||
if: needs.info.outputs.skip_coverage != 'true' | ||
uses: actions/[email protected].4 | ||
uses: actions/[email protected].6 | ||
with: | ||
name: coverage-${{ matrix.python-version }}-${{ matrix.group }} | ||
path: coverage.xml | ||
|
@@ -951,6 +967,7 @@ jobs: | |
&& github.event.inputs.lint-only != 'true' | ||
&& github.event.inputs.pylint-only != 'true' | ||
&& github.event.inputs.mypy-only != 'true' | ||
&& github.event.inputs.audit-licenses-only != 'true' | ||
&& needs.info.outputs.mariadb_groups != '[]' | ||
needs: | ||
- info | ||
|
@@ -1043,15 +1060,15 @@ jobs: | |
2>&1 | tee pytest-${{ matrix.python-version }}-${mariadb}.txt | ||
- name: Upload pytest output | ||
if: success() || failure() && steps.pytest-partial.conclusion == 'failure' | ||
uses: actions/[email protected].4 | ||
uses: actions/[email protected].6 | ||
with: | ||
name: pytest-${{ github.run_number }}-${{ matrix.python-version }}-${{ | ||
steps.pytest-partial.outputs.mariadb }} | ||
path: pytest-*.txt | ||
overwrite: true | ||
- name: Upload coverage artifact | ||
if: needs.info.outputs.skip_coverage != 'true' | ||
uses: actions/[email protected].4 | ||
uses: actions/[email protected].6 | ||
with: | ||
name: coverage-${{ matrix.python-version }}-${{ | ||
steps.pytest-partial.outputs.mariadb }} | ||
|
@@ -1076,6 +1093,7 @@ jobs: | |
&& github.event.inputs.lint-only != 'true' | ||
&& github.event.inputs.pylint-only != 'true' | ||
&& github.event.inputs.mypy-only != 'true' | ||
&& github.event.inputs.audit-licenses-only != 'true' | ||
&& needs.info.outputs.postgresql_groups != '[]' | ||
needs: | ||
- info | ||
|
@@ -1169,15 +1187,15 @@ jobs: | |
2>&1 | tee pytest-${{ matrix.python-version }}-${postgresql}.txt | ||
- name: Upload pytest output | ||
if: success() || failure() && steps.pytest-partial.conclusion == 'failure' | ||
uses: actions/[email protected].4 | ||
uses: actions/[email protected].6 | ||
with: | ||
name: pytest-${{ github.run_number }}-${{ matrix.python-version }}-${{ | ||
steps.pytest-partial.outputs.postgresql }} | ||
path: pytest-*.txt | ||
overwrite: true | ||
- name: Upload coverage artifact | ||
if: needs.info.outputs.skip_coverage != 'true' | ||
uses: actions/[email protected].4 | ||
uses: actions/[email protected].6 | ||
with: | ||
name: coverage-${{ matrix.python-version }}-${{ | ||
steps.pytest-partial.outputs.postgresql }} | ||
|
@@ -1220,6 +1238,7 @@ jobs: | |
&& github.event.inputs.lint-only != 'true' | ||
&& github.event.inputs.pylint-only != 'true' | ||
&& github.event.inputs.mypy-only != 'true' | ||
&& github.event.inputs.audit-licenses-only != 'true' | ||
&& needs.info.outputs.tests_glob | ||
&& needs.info.outputs.test_full_suite == 'false' | ||
needs: | ||
|
@@ -1310,14 +1329,14 @@ jobs: | |
2>&1 | tee pytest-${{ matrix.python-version }}-${{ matrix.group }}.txt | ||
- name: Upload pytest output | ||
if: success() || failure() && steps.pytest-partial.conclusion == 'failure' | ||
uses: actions/[email protected].4 | ||
uses: actions/[email protected].6 | ||
with: | ||
name: pytest-${{ github.run_number }}-${{ matrix.python-version }}-${{ matrix.group }} | ||
path: pytest-*.txt | ||
overwrite: true | ||
- name: Upload coverage artifact | ||
if: needs.info.outputs.skip_coverage != 'true' | ||
uses: actions/[email protected].4 | ||
uses: actions/[email protected].6 | ||
with: | ||
name: coverage-${{ matrix.python-version }}-${{ matrix.group }} | ||
path: coverage.xml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,11 +24,11 @@ jobs: | |
uses: actions/[email protected] | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3.25.15 | ||
uses: github/codeql-action/init@v3.26.5 | ||
with: | ||
languages: python | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3.25.15 | ||
uses: github/codeql-action/analyze@v3.26.5 | ||
with: | ||
category: "/language:python" |
Oops, something went wrong.