mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-15 00:04:05 +02:00
117 lines
4.5 KiB
YAML
117 lines
4.5 KiB
YAML
name: pytest
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
|
|
jobs:
|
|
pytest:
|
|
name: Run pytest
|
|
runs-on: ubuntu-20.04
|
|
timeout-minutes: 60
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
# - python-version: "3.10"
|
|
# core-version: "2022.11.5"
|
|
# - python-version: "3.10"
|
|
# core-version: "2022.12.9"
|
|
# - python-version: "3.10"
|
|
# core-version: "2023.1.7"
|
|
# - python-version: "3.10"
|
|
# core-version: "2023.2.5"
|
|
# - python-version: "3.10"
|
|
# core-version: "2023.3.6"
|
|
# - python-version: "3.10"
|
|
# core-version: "2023.4.6"
|
|
# - python-version: "3.10"
|
|
# core-version: "2023.5.2"
|
|
- python-version: "3.11"
|
|
core-version: "2023.6.1"
|
|
- python-version: "3.11"
|
|
core-version: "2023.7.3"
|
|
- python-version: "3.11"
|
|
# 2023.7.3
|
|
core-version: "40b5605cafcf81925c6066545b0bc226ee78a4e4" # 2023.7.3
|
|
- python-version: "3.11"
|
|
core-version: "aa13082ce0dd9fb29e631c9280449428822d8000"
|
|
- python-version: "3.11"
|
|
core-version: "bc6a41fb9465523998b2e152dd7f3d4275f2cc9d"
|
|
- python-version: "3.11"
|
|
core-version: "4bf23fac6f50eeebd127b979212a7ea607e0f212"
|
|
- python-version: "3.11"
|
|
core-version: "863b36c0c30010c3ea79afc32bfaf46bb6687922"
|
|
- python-version: "3.11"
|
|
core-version: "560e0cc7e0c759adba3b7ad16fbb72e67794e67d"
|
|
- python-version: "3.11"
|
|
core-version: "57361a738e26de2b83cd5f8478c140ae92b1b6dc"
|
|
- python-version: "3.11"
|
|
core-version: "2f8b88e6ef767c3ca27f4d2e96837c4d65c59666"
|
|
- python-version: "3.11"
|
|
core-version: "f809b7284be577386c2f292007168a470285bcba"
|
|
- python-version: "3.11"
|
|
core-version: "1e9a5e48c32ec055c4aa18f98128cb2d0f7baa55"
|
|
- python-version: "3.11"
|
|
core-version: "63115a906d7c8ede02be7ee9c30ac95d0c5ff7b8"
|
|
- python-version: "3.11"
|
|
core-version: "d35e5db9843624f560e0bf4934568bca90478d6d"
|
|
- python-version: "3.11"
|
|
core-version: "72458b66725c9f05a8c7e4e338bc8f89b5c41fb6"
|
|
- python-version: "3.11"
|
|
core-version: "3e429ae081a6d559bb397dcf99c4674431f79629"
|
|
- python-version: "3.11"
|
|
core-version: "3b80deb2b74d642e805f6b1abaa8c4be9253439e"
|
|
- python-version: "3.11"
|
|
core-version: "2023.8.0b0"
|
|
- python-version: "3.11"
|
|
core-version: "2023.8.0"
|
|
- python-version: "3.11"
|
|
core-version: "dev"
|
|
steps:
|
|
- name: Check out code from GitHub
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install Home Assistant
|
|
uses: ./.github/workflows/install_dependencies
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
core-version: ${{ matrix.core-version }}
|
|
|
|
- name: Click here for troubleshooting steps if tests break again.
|
|
run: |
|
|
echo "::notice::### If tests fail, try these debug steps: ###"
|
|
echo "::notice::### 1. Replace '-qq' from .github/workflow/pytest.yaml. with '-v' for extra verbosity. ###"
|
|
echo "::notice::### 2. Push or run action again. ###"
|
|
echo "::notice::### 3. Check for any log messages in github actions resembling the following using CTRL+F ###
|
|
echo "::notice::### 4. ERROR:homeassistant.setup:Setup failed for 'component': Unable to import component: No module named ''module'' ###"
|
|
echo "::notice::### 5. add 'component'.'module' (without the '') from the above log into the 'required' list inside of 'test_dependencies.py' ###"
|
|
echo "::notice::### 6. Try again! If more issues persist they should be easily solvable by reading the verbose logs now. ###"
|
|
|
|
- name: Link custom_components/adaptive_lighting
|
|
run: |
|
|
cd core
|
|
|
|
# Link adaptive_lighting tests
|
|
cd tests/components/
|
|
ln -fs ../../../tests adaptive_lighting
|
|
cd -
|
|
|
|
- name: Run pytest
|
|
timeout-minutes: 60
|
|
run: |
|
|
export PYTHONPATH=${PYTHONPATH}:${PWD}
|
|
cd core
|
|
python3 -X dev -m pytest \
|
|
-vvv \
|
|
-qq \
|
|
--timeout=9 \
|
|
--durations=10 \
|
|
--cov="custom_components.adaptive_lighting" \
|
|
--cov-report=xml \
|
|
-o console_output_style=count \
|
|
-p no:sugar \
|
|
tests/components/adaptive_lighting
|
|
env:
|
|
HA_CLONE: true
|