generated from ludeeus/integration_blueprint
-
-
Notifications
You must be signed in to change notification settings - Fork 5
84 lines (79 loc) · 2.25 KB
/
pull.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Pull actions
on:
pull_request:
jobs:
validate:
runs-on: "ubuntu-latest"
name: Validate
steps:
- uses: actions/checkout@v3
- name: HACS validation
uses: "hacs/action@main"
with:
category: "integration"
ignore: brands
- name: Hassfest validation
uses: "home-assistant/actions/hassfest@master"
style:
runs-on: "ubuntu-latest"
name: Check style formatting
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- run: python3 -m pip install black
- run: black .
cache-requirements-install:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Cache pip dependencies
uses: actions/cache@v3
id: cache-dependencies
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
pip install -r requirements_test.txt
tests:
needs: cache-requirements-install
runs-on: "ubuntu-latest"
name: Run tests
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Restore pip cache dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install requirements
run: python3 -m pip install -r requirements_test.txt
- name: Run tests
run: |
pytest \
-qq \
--timeout=9 \
--durations=10 \
-n auto \
--cov custom_components.bouncie \
-o console_output_style=count \
-p no:sugar \
--cov-fail-under=100 \
tests