Skip to content

Commit

Permalink
Merge branch 'master' into medisanabp_ble
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus authored Dec 19, 2024
2 parents 366ddc0 + 3832dcf commit 2d16b0b
Show file tree
Hide file tree
Showing 18 changed files with 624 additions and 124 deletions.
15 changes: 13 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
labels:
- "pr: dependency-update"
schedule:
interval: "weekly"

interval: weekly
time: "06:00"
open-pull-requests-limit: 10
- package-ecosystem: "pip"
directory: "/"
labels:
- "pr: dependency-update"
schedule:
interval: weekly
time: "06:00"
open-pull-requests-limit: 10
124 changes: 67 additions & 57 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: "Checks"
name: Check

on:
pull_request:
types:
Expand All @@ -10,31 +11,34 @@ on:
- master
paths:
- appdaemon
- blacklist
- critical
- integration
- netdaemon
- plugin
- python_script
- removed
- template
- theme

concurrency:
group: checks-${{ github.ref }}
cancel-in-progress: true

permissions: {}

jobs:
preflight:
runs-on: ubuntu-latest
name: Initialize
name: Preflight
outputs:
repository: ${{ steps.repository.outputs.repository }}
category: ${{ steps.category.outputs.category }}
removal: ${{ steps.removal.outputs.removal }}
steps:
- name: Check out repository
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4.2.2

- name: Set up Python
uses: actions/setup-python@v5.3.0
with:
python-version-file: ".python-version"

- name: Clone origin
run: git clone --depth 1 https://github.com/hacs/default /tmp/repositories/default
Expand All @@ -43,45 +47,32 @@ jobs:
id: repository
run: echo "repository=$(python3 -m scripts.changed.repo)" >> $GITHUB_OUTPUT

- name: Set category
id: category
run: echo "category=$(python3 -m scripts.changed.category)" >> $GITHUB_OUTPUT

- name: Check removal
id: removal
run: |
if [ "${{ steps.repository.outputs.repository }}" == "Bad data []" ]; then
echo "removal=true" >> $GITHUB_OUTPUT
fi
- name: Set category
if: steps.removal.outputs.removal != 'true'
id: category
run: echo "category=$(python3 -m scripts.changed.category)" >> $GITHUB_OUTPUT

- name: Clone new addition
if: steps.removal.outputs.removal != 'true'
run: |
repo=$(python3 -m scripts.changed.repo)
git clone --depth 1 "https://github.com/$repo" /tmp/repositories/addition
- name: Upload shared artifacts
if: steps.removal.outputs.removal != 'true'
uses: actions/upload-artifact@v3
with:
name: repositories
path: /tmp/repositories

owner:
runs-on: ubuntu-latest
name: Check Owner
name: Owner
needs: preflight
if: needs.preflight.outputs.removal != 'true'
steps:
- name: Check out repository
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4.2.2

- name: Download shared artifacts
uses: actions/download-artifact@v3
- name: Set up Python
uses: actions/setup-python@v5.3.0
with:
name: repositories
path: /tmp/repositories
python-version-file: ".python-version"
cache: "pip"
cache-dependency-path: "requirements.txt"

- name: Install dependencies if needed
run: scripts/setup
Expand All @@ -90,63 +81,82 @@ jobs:
run: python3 -m scripts.check.owner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY: ${{needs.preflight.outputs.repository}}

edits:
editable:
runs-on: ubuntu-latest
name: Check if PR is editable
name: Editable PR
steps:
- name: Check out repository
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4.2.2

- name: Set up Python
uses: actions/setup-python@v5.3.0
with:
python-version-file: ".python-version"
cache: "pip"
cache-dependency-path: "requirements.txt"


- name: Install dependencies if needed
run: scripts/setup

- name: Run the check
run: python3 -m scripts.check.edits


hassfest:
removed:
runs-on: ubuntu-latest
name: "Check hassfest"
name: Removed repository
needs: preflight
if: needs.preflight.outputs.category == 'integration'
if: needs.preflight.outputs.removal != 'true'
steps:
- name: Check out repository
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4.2.1

- name: Download shared artifacts
uses: actions/download-artifact@v3
- name: Set up Python
uses: actions/setup-python@v5.2.0
with:
name: repositories
path: /tmp/repositories
python-version-file: ".python-version"
cache: "pip"
cache-dependency-path: "requirements.txt"

- name: Get hassfest action
run: |
git clone --depth 1 https://github.com/home-assistant/actions.git /tmp/actions
echo "::add-matcher::/tmp/actions/hassfest/problem-matcher.json"
- name: Install dependencies if needed
run: scripts/setup

- name: Run the check
run: python3 -m scripts.check.removed
env:
REPOSITORY: ${{needs.preflight.outputs.repository}}

- name: Enable problem-matcher
run: echo "::add-matcher::/tmp/actions/hassfest/problem-matcher.json"
hassfest:
runs-on: ubuntu-latest
name: Hassfest
needs: preflight
if: needs.preflight.outputs.category == 'integration' && needs.preflight.outputs.removal != 'true'
steps:
- name: Check out repository
uses: actions/checkout@v4.2.2

- name: Build hassfest
run: docker build /tmp/actions/hassfest -f /tmp/actions/hassfest/Dockerfile -t hassfest
- name: Clone new addition
run: |
git clone --depth 1 "https://github.com/${{needs.preflight.outputs.repository}}" /tmp/repositories/addition
- name: Run hassfest
run: |
integration=$(python3 -m scripts.helpers.integration_path)
domain=$(python3 -m scripts.helpers.domain)
docker run \
--rm \
docker run --rm \
-v "$integration":"/github/workspace/$domain" \
hassfest
ghcr.io/home-assistant/hassfest:latest
hacs:
runs-on: ubuntu-latest
name: "Run HACS Action"
name: HACS action
needs: preflight
if: needs.preflight.outputs.removal != 'true'
steps:
- name: HACS action
uses: "hacs/action@main"
uses: hacs/action@main
with:
repository: ${{needs.preflight.outputs.repository}}
category: ${{needs.preflight.outputs.category}}
category: ${{needs.preflight.outputs.category}}
36 changes: 33 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,47 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4.2.2

- name: Validate
run: jq --raw-output . appdaemon blacklist critical integration netdaemon plugin python_script removed template theme

jsonschema:
name: JSON schema
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4.2.2

- name: Critical
uses: cardinalby/schema-validator-action@3.1.1
with:
file: "critical"
schema: "tools/jsonschema/critical.schema.json"

- name: Repositories
uses: cardinalby/schema-validator-action@3.1.1
with:
file: "appdaemon|blacklist|integration|netdaemon|plugin|python_script|template|theme"
schema: "tools/jsonschema/repositories.schema.json"

- name: Removed
uses: cardinalby/schema-validator-action@3.1.1
with:
file: "removed"
schema: "tools/jsonschema/removed.schema.json"

sorted:
name: Sorted
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4.2.2

- name: Set up Python
uses: actions/setup-python@v5.3.0
with:
python-version-file: ".python-version"

- name: Check lists
run: python3 scripts/is_sorted.py
run: python3 scripts/is_sorted.py
14 changes: 10 additions & 4 deletions .github/workflows/upload-critical.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,24 @@ jobs:
name: Upload
steps:
- name: Checkout the repository
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4.2.2

- name: Validate with JSON schema
uses: cardinalby/schema-validator-action@3.1.1
with:
file: 'critical'
schema: 'tools/jsonschema/critical.schema.json'

- name: Set up Python
uses: actions/setup-python@v5.0.0
uses: actions/setup-python@v5.3.0
id: python
with:
python-version: "3.x"

- name: Install AWS CLI
run: |
pip3 install \
--disable-pip-version-check install \
--disable-pip-version-check \
--ignore-installed \
awscli
Expand All @@ -40,7 +46,7 @@ jobs:
jq -c '[.[].repository]' < critical > upload/critical/repositories.json
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: critical
path: upload/critical
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/upload-removed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,24 @@ jobs:
name: Upload
steps:
- name: Checkout the repository
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4.2.2

- name: Validate with JSON schema
uses: cardinalby/schema-validator-action@3.1.1
with:
file: 'removed'
schema: 'tools/jsonschema/removed.schema.json'

- name: Set up Python
uses: actions/setup-python@v5.0.0
uses: actions/setup-python@v5.3.0
id: python
with:
python-version: "3.x"

- name: Install AWS CLI
run: |
pip3 install \
--disable-pip-version-check install \
--disable-pip-version-check \
--ignore-installed \
awscli
Expand All @@ -40,7 +46,7 @@ jobs:
jq -c '[.[].repository]' < removed > upload/removed/repositories.json
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: removed
path: upload/removed
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10
13 changes: 2 additions & 11 deletions appdaemon
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,7 @@
"NiklasReiche/ad-spotify-mood-lights-sync",
"nra4ever/calremind",
"Odianosen25/Monitor-App",
"Petro31/ad_convert_media_volume",
"Petro31/ad_count_entities",
"Petro31/ad_group_all",
"Petro31/ad_monitor_events",
"Petro31/ad_seasonal_lights",
"Petro31/ad_simple_door_bell",
"Petro31/ad_sunset_lights",
"Petro31/ad_toggle_light",
"Petro31/ad_who_used_the_door",
"Petro31/IlluminateDoor",
"Pythm/ad-ClimateCommander",
"Pythm/ad-Lightwand",
"roopesh/ad-qolsys",
"simonhq/accu_allergies",
Expand All @@ -67,4 +58,4 @@
"wernerhp/ha.appdaemon.wasp",
"XaF/qolsysgw",
"xaviml/controllerx"
]
]
Loading

0 comments on commit 2d16b0b

Please sign in to comment.