mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2025-06-21 15:20:00 +08:00
feat: check rule format with pytest
This commit is contained in:
27
.github/workflows/test.yaml
vendored
Normal file
27
.github/workflows/test.yaml
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
check-rule-format:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [validate-lint]
|
||||
steps:
|
||||
- name: Checkout the repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install pytest pytest-asyncio
|
||||
|
||||
- name: Check rule format with pytest
|
||||
run: |
|
||||
pytest -v -s ./test/check_rule_format.py
|
17
.github/workflows/validate.yaml
vendored
17
.github/workflows/validate.yaml
vendored
@ -3,10 +3,11 @@ name: Validate
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
validate-hassfest:
|
||||
@ -30,16 +31,6 @@ jobs:
|
||||
category: integration
|
||||
ignore: brands
|
||||
|
||||
validate-format:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout the repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Check format
|
||||
run: |
|
||||
./custom_components/xiaomi_home/test/test_all.sh
|
||||
|
||||
validate-lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
@ -51,7 +42,7 @@ jobs:
|
||||
python -m pip install --upgrade pip
|
||||
pip install pylint
|
||||
|
||||
- name: Analyse the code with pylint
|
||||
- name: Static analyse the code with pylint
|
||||
run: |
|
||||
pylint $(git ls-files '*.py')
|
||||
|
||||
|
Reference in New Issue
Block a user