mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-14 15:54:04 +02:00
171 lines
7.3 KiB
YAML
171 lines
7.3 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: "4bf23fac6f50eeebd127b979212a7ea607e0f212"
|
|
- python-version: "3.11"
|
|
core-version: "ca2863a1b928ba904f8342614aa5edf1bfcc5e20"
|
|
- python-version: "3.11"
|
|
core-version: "a9f75228579084f6a8c47882802ef0c22ba0edbe"
|
|
- python-version: "3.11"
|
|
core-version: "eb60dc65ec0df7ce1e4166b6fc1af750472d783a"
|
|
- python-version: "3.11"
|
|
core-version: "771b5e34b7442b577c545db07409b9c797cd1daa"
|
|
- python-version: "3.11"
|
|
core-version: "44aa531a5177ffeed58d704d7710336a4c078ee4"
|
|
- python-version: "3.11"
|
|
core-version: "564e618d0c9c34aef85052959886f80a5770df24"
|
|
- python-version: "3.11"
|
|
core-version: "8cccfcc9465aaa0e904650a71543f8cff03f8cb6"
|
|
- python-version: "3.11"
|
|
core-version: "c79fa87a7f772528f73d7606bc9914c296bcae2b"
|
|
- python-version: "3.11"
|
|
core-version: "49a27bb9a75bd74effa131252329230a98c241d6"
|
|
- python-version: "3.11"
|
|
core-version: "863b36c0c30010c3ea79afc32bfaf46bb6687922"
|
|
- python-version: "3.11"
|
|
core-version: "8559af8232a19f9c078930186d60c441ac93383a"
|
|
- python-version: "3.11"
|
|
core-version: "1e3fdcc4d196821dfba24c9b3df3f0827ea87fdd"
|
|
- python-version: "3.11"
|
|
core-version: "d02bf837a6cdb5e44e029bca39035212e2958d24"
|
|
- python-version: "3.11"
|
|
core-version: "d80b7d0145c15d2dd593a84d98c4f6704b82fdb8"
|
|
- python-version: "3.11"
|
|
core-version: "36cb3f72781f4d4441fe760c3b105d4ed0edda39"
|
|
- python-version: "3.11"
|
|
core-version: "31dfa5561a65ecc55fbf93d97b789d63638bd1d2"
|
|
- python-version: "3.11"
|
|
core-version: "aa87f0ad546d95028cfa62ab57a69f260fb11189"
|
|
- python-version: "3.11"
|
|
core-version: "a4d4eb3871d689aa53cf26a5caae2b538a64ac7a"
|
|
- python-version: "3.11"
|
|
core-version: "e99b6b2a0328b361f494c1d0c188161406e9e840"
|
|
- python-version: "3.11"
|
|
core-version: "560e0cc7e0c759adba3b7ad16fbb72e67794e67d"
|
|
- python-version: "3.11"
|
|
core-version: "70c88a125c9937fb50ef832af04814a90d9ca11e"
|
|
- python-version: "3.11"
|
|
core-version: "7ccb06ed2247e7c3ba753f2300fe92f8d12016e2"
|
|
- python-version: "3.11"
|
|
core-version: "005e45edcc3de1400808e7c889f4e0646960d310"
|
|
- python-version: "3.11"
|
|
core-version: "8937884e33866938764cdc6b0d126531d95641ae"
|
|
- python-version: "3.11"
|
|
core-version: "34f1b2b71d208a3f040442cd450f8c03c5c04f35"
|
|
- python-version: "3.11"
|
|
core-version: "98e166f795690cc60133572873d89ad6ecc30a98"
|
|
- python-version: "3.11"
|
|
core-version: "e76254a50fe0d546300ce34e5ae45df3e4cfea1f"
|
|
- python-version: "3.11"
|
|
core-version: "b0dd05a411eb027cd5feb9268bc8a211a5c1aba8"
|
|
- python-version: "3.11"
|
|
core-version: "73bbfc7a2d7e85229da8a22c719e8a8d064dcd49"
|
|
- python-version: "3.11"
|
|
core-version: "57361a738e26de2b83cd5f8478c140ae92b1b6dc"
|
|
- python-version: "3.11"
|
|
core-version: "dc8267b05a5c81c484b10d0ab11daf88cbdfdfe4"
|
|
- python-version: "3.11"
|
|
core-version: "5a951c390b5c2b6554c5ca0018d609e9336fb741"
|
|
- python-version: "3.11"
|
|
core-version: "56bc708b28d93ddc354593d5c02af3655febde6b"
|
|
- python-version: "3.11"
|
|
core-version: "4a6247f922a41f3145a30b1e071aa92f1dcdd1f1"
|
|
- python-version: "3.11"
|
|
core-version: "e29b6408f6581c5ccd133a94fc00a08c6455aec9"
|
|
- python-version: "3.11"
|
|
core-version: "65ebb6a74f4a276e557b17898720f6eac5741bf9"
|
|
- python-version: "3.11"
|
|
core-version: "3a06659120aa629e0db290ec9e83e2ad129baaf3"
|
|
- python-version: "3.11"
|
|
core-version: "c76fac0633749e8f463f9b6c22a4d47bba5ba1e7"
|
|
- python-version: "3.11"
|
|
core-version: "657fdb075ad4d79ad21c442495f0145d6e672f3c"
|
|
- python-version: "3.11"
|
|
core-version: "2f8b88e6ef767c3ca27f4d2e96837c4d65c59666"
|
|
- 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
|