Skip to content

Commit

Permalink
Add tests on homeassistant@dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Limych committed May 27, 2021
1 parent 2a40eee commit 6f5a1bb
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 2 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/py-test-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
name: "Python testing on homeassistant@dev"

on:
push:
branches:
- master
- main
- dev
pull_request:
schedule:
- cron: "30 3 * * 1"

jobs:
tests:
name: "Test package on homeassistant@dev"
runs-on: ubuntu-latest
continue-on-error: true
strategy:
max-parallel: 4
matrix:
python-version: [3.8, 3.9, '3.10-dev']
steps:
- name: "Checkout code"
uses: actions/checkout@master

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: "Cache pip"
uses: actions/cache@v2.1.5
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
# Prefer requirements-test.txt
if [ -f requirements-test.txt ]; then
bin/install_requirements requirements-test.txt "${{ secrets.ADMIN_GITHUB_TOKEN }}"
elif [ -f requirements-dev.txt ]; then
bin/install_requirements requirements-dev.txt "${{ secrets.ADMIN_GITHUB_TOKEN }}"
elif [ -f requirements.txt ]; then
bin/install_requirements requirements.txt "${{ secrets.ADMIN_GITHUB_TOKEN }}"
fi
pip install pytest-xdist
pip install --upgrade git+git://github.com/home-assistant/home-assistant.git@dev
if [ -d custom_components ]; then
echo '"""Stub."""' >custom_components/__init__.py
fi
- name: "Run tests with pytest"
run: |
pytest --basetemp=$RUNNER_TEMP --durations=10 -n auto --dist=loadfile -qq -o console_output_style=count -p no:sugar
./bin/check_dirty
2 changes: 0 additions & 2 deletions .github/workflows/py-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ on:
- main
- dev
pull_request:
schedule:
- cron: "30 3 * * 1"

jobs:
lint:
Expand Down
1 change: 1 addition & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
-r requirements.txt
asynctest~=0.13
flake8~=3.9
flake8-docstrings~=1.6
mypy==0.812
pylint~=2.8
pylint-strict-informational==0.1
Expand Down

0 comments on commit 6f5a1bb

Please sign in to comment.