Skip to content

Commit

Permalink
Run tests on push
Browse files Browse the repository at this point in the history
  • Loading branch information
arjenbos committed Oct 28, 2023
1 parent a93e1df commit 84ca39e
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Tests

on: [push]

jobs:
test:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"

- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov
pip install -r requirements-test.txt
- name: pytest
run: |
pytest --junitxml=pytest.xml --cov-report="xml:coverage.xml" --cov=custom_components/alpha_innotec tests/
- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-xml-coverage-path: ./coverage.xml
junitxml-path: ./pytest.xml
title: HA Alpha Innotec
badge-title: HA Alpha Innotec Coverage
hide-badge: false
hide-report: false
create-new-comment: false
hide-comment: false
report-only-changed-files: false
remove-link-from-badge: false
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
venv
.vscode
*.code-workspace
*.pyc
*.swp
__pycache__
env
.mypy_cache
.coverage
coverage.xml
.secrets
.pytest_cache

1 comment on commit 84ca39e

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.