Add .github/workflows/ci.yaml

This commit is contained in:
Bas Nijholt 2022-08-28 12:26:57 -07:00
commit d141355817

57
.github/workflows/ci.yaml vendored Normal file
View file

@ -0,0 +1,57 @@
name: CI
# yamllint disable-line rule:truthy
on:
push:
branches:
- dev
- rc
- master
pull_request: ~
env:
CACHE_VERSION: 1
PIP_CACHE_VERSION: 1
HA_SHORT_VERSION: 2022.9
DEFAULT_PYTHON: 3.9
PRE_COMMIT_CACHE: ~/.cache/pre-commit
PIP_CACHE: /tmp/pip-cache
SQLALCHEMY_WARN_20: 1
PYTHONASYNCIODEBUG: 1
HASS_CI: 1
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
base:
name: Prepare dependencies
runs-on: ubuntu-20.04
needs: info
timeout-minutes: 60
strategy:
matrix:
python-version: ["3.9", "3.10"]
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.0.2
- name: Check out code from GitHub
uses: actions/checkout@v3.0.2
with:
repository: home-assistant/core
path: homeassistant
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v4.1.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e homeassistant/
- name: Run pytest
timeout-minutes: 60
run: |
pytest tests