-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (56 loc) · 1.71 KB
/
validate.yml
File metadata and controls
61 lines (56 loc) · 1.71 KB
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
name: Validate
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
permissions: {}
jobs:
validate-hacs:
name: HACS Validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: HACS validation
uses: "hacs/action@main"
with:
category: "integration"
hassfest:
name: Hassfest
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
with:
path: tmp_src
- name: Create expected directory structure for hassfest
run: |
mkdir -p custom_components/solar_energy_management
rsync -a --exclude='.git' --exclude='.github' --exclude='tmp_src' tmp_src/ custom_components/solar_energy_management/
rm -rf tmp_src
- name: Hassfest (with retry on ghcr rate limit)
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 3
retry_wait_seconds: 30
command: |
docker run --rm \
-v "$GITHUB_WORKSPACE":/github/workspace \
ghcr.io/home-assistant/hassfest
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: custom_components/solar_energy_management
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install -r custom_components/solar_energy_management/tests/requirements_test.txt
- run: python -m pytest tests/ --ignore=tests/test_energy_flow_balance.py --ignore=tests/test_flow_accumulation.py -v
working-directory: custom_components/solar_energy_management