Linting and Testing #1992
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: "Linting and Testing" | |
on: | |
push: | |
branches: | |
- main | |
- master | |
- dev | |
pull_request: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
pre-commit: | |
runs-on: "ubuntu-latest" | |
name: Pre-commit | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
- name: Install poetry | |
run: pipx install poetry | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: pyproject.toml | |
cache: "poetry" | |
- name: Install Python modules | |
run: | | |
poetry install --no-root | |
- name: Run pre-commit on all files | |
run: | | |
poetry run pre-commit run --all-files --show-diff-on-failure --color=always | |
hacs: | |
runs-on: "ubuntu-latest" | |
name: HACS | |
steps: | |
- name: Check out the repository | |
uses: "actions/checkout@v4" | |
- name: HACS validation | |
uses: "hacs/[email protected]" | |
with: | |
category: "integration" | |
hassfest: | |
runs-on: "ubuntu-latest" | |
name: Hassfest | |
steps: | |
- name: Check out the repository | |
uses: "actions/checkout@v4" | |
- name: Hassfest validation | |
uses: "home-assistant/actions/hassfest@master" | |
test: | |
runs-on: "ubuntu-latest" | |
name: "Test" | |
steps: | |
- name: Check out the repository | |
uses: "actions/checkout@v4" | |
- name: Install poetry | |
run: pipx install poetry | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: pyproject.toml | |
cache: "poetry" | |
- name: Install Python modules | |
run: | | |
poetry install --no-root | |
- name: Run pytest | |
uses: pavelzw/pytest-action@v2 | |
with: | |
custom-pytest: "poetry run pytest" | |
verbose: true | |
emoji: true | |
job-summary: true | |
click-to-expand: false |