-
Notifications
You must be signed in to change notification settings - Fork 37
57 lines (51 loc) · 1.51 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
name: Pull actions
on:
pull_request:
jobs:
validate:
runs-on: "ubuntu-latest"
name: Validate
steps:
- uses: "actions/checkout@v4"
- name: HACS validation
uses: "hacs/action@main"
with:
category: "integration"
- name: Hassfest validation
uses: "home-assistant/actions/hassfest@master"
style:
runs-on: "ubuntu-latest"
name: Check style formatting
steps:
- uses: "actions/checkout@v4"
- uses: "actions/setup-python@v5"
with:
python-version: "3.12"
- run: python3 -m pip install poetry~=1.8
- run: poetry install
- run: poetry run ./scripts/lint --no-fix
tests:
runs-on: "ubuntu-latest"
name: Run tests
steps:
- name: Check out code from GitHub
uses: "actions/checkout@v4"
- name: Setup Python
uses: "actions/setup-python@v5"
with:
python-version: "3.12"
- name: Install requirements
run: python3 -m pip install poetry~=1.8 && poetry install
- name: Run tests
run: |
poetry run pytest --cov=./custom_components --cov-report=xml --cov-report=html
- name: Save PR number and coverage results
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/PR-number.txt
cp ./test_results/cov_xml/coverage.xml ./pr/coverage.xml
cp ./test_results/pytest.xml ./pr/pytest.xml
- uses: actions/upload-artifact@v4
with:
name: pr
path: pr/