fix: UnboundLocalError when supervised without addon (#904) #265
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
name: Push actions | |
on: | |
push: | |
branches: | |
- dev | |
jobs: | |
validate: | |
runs-on: "ubuntu-latest" | |
name: Validate | |
steps: | |
- uses: "actions/checkout@v2" | |
- name: HACS validation | |
uses: "hacs/action@main" | |
with: | |
category: "integration" | |
ignore: brands | |
- name: Hassfest validation | |
uses: "home-assistant/actions/hassfest@master" | |
style: | |
runs-on: "ubuntu-latest" | |
name: Check style formatting | |
steps: | |
- uses: "actions/checkout@v2" | |
- uses: "actions/setup-python@v1" | |
with: | |
python-version: "3.x" | |
- run: python3 -m pip install black | |
- run: black . | |
todo: | |
runs-on: "ubuntu-latest" | |
name: Setup TODO issues | |
steps: | |
- uses: "actions/checkout@v3" | |
- name: "TODO to Issue" | |
uses: "alstr/todo-to-issue-action@v4" | |
tests: | |
runs-on: "ubuntu-latest" | |
name: Run tests | |
steps: | |
- name: Check out code from GitHub | |
uses: "actions/checkout@v2" | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.12" | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
#---------------------------------------------- | |
# load cached venv if cache exists | |
#---------------------------------------------- | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v2 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | |
#---------------------------------------------- | |
# install dependencies if cache does not exist | |
#---------------------------------------------- | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install --no-interaction --no-root | |
#---------------------------------------------- | |
# install your root project, if required | |
#---------------------------------------------- | |
- name: Install library | |
run: poetry install --no-interaction | |
- name: Run tests | |
run: | | |
poetry run pytest \ | |
-qq \ | |
--timeout=9 \ | |
--durations=10 \ | |
-n auto \ | |
--cov custom_components.tesla_custom \ | |
-o console_output_style=count \ | |
-p no:sugar \ | |
tests |