Skip to content

Commit

Permalink
Merge branch 'master' into add-week-planner-card
Browse files Browse the repository at this point in the history
  • Loading branch information
FamousWolf authored Sep 5, 2024
2 parents 7c53be2 + 1674309 commit 8a7ba95
Show file tree
Hide file tree
Showing 13 changed files with 317 additions and 109 deletions.
88 changes: 27 additions & 61 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,29 @@ 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/[email protected].1
uses: actions/[email protected].7

- name: Clone origin
run: git clone --depth 1 https://github.com/hacs/default /tmp/repositories/default
Expand All @@ -43,45 +42,25 @@ 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/[email protected]

- name: Download shared artifacts
uses: actions/download-artifact@v3
with:
name: repositories
path: /tmp/repositories
uses: actions/[email protected]

- name: Install dependencies if needed
run: scripts/setup
Expand All @@ -90,63 +69,50 @@ 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/[email protected].1
uses: actions/[email protected].7

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

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


hassfest:
runs-on: ubuntu-latest
name: "Check hassfest"
name: Hassfest
needs: preflight
if: needs.preflight.outputs.category == 'integration'
if: needs.preflight.outputs.category == 'integration' && needs.preflight.outputs.removal != 'true'
steps:
- name: Check out repository
uses: actions/[email protected].1
uses: actions/[email protected].7

- name: Download shared artifacts
uses: actions/download-artifact@v3
with:
name: repositories
path: /tmp/repositories

- name: Get hassfest action
- name: Clone new addition
run: |
git clone --depth 1 https://github.com/home-assistant/actions.git /tmp/actions
echo "::add-matcher::/tmp/actions/hassfest/problem-matcher.json"
- name: Enable problem-matcher
run: echo "::add-matcher::/tmp/actions/hassfest/problem-matcher.json"

- name: Build hassfest
run: docker build /tmp/actions/hassfest -f /tmp/actions/hassfest/Dockerfile -t hassfest
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}}
31 changes: 28 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,42 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/[email protected].1
uses: actions/[email protected].7

- 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/[email protected]

- name: Critical
uses: cardinalby/[email protected]
with:
file: "critical"
schema: "tools/jsonschema/critical.schema.json"

- name: Repositories
uses: cardinalby/[email protected]
with:
file: "appdaemon|blacklist|integration|netdaemon|plugin|python_script|template|theme"
schema: "tools/jsonschema/repositories.schema.json"

- name: Removed
uses: cardinalby/[email protected]
with:
file: "removed"
schema: "tools/jsonschema/removed.schema.json"

sorted:
name: Sorted
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/[email protected].1
uses: actions/[email protected].7

- 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/[email protected]
uses: actions/[email protected]

- name: Validate with JSON schema
uses: cardinalby/[email protected]
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.2.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/[email protected]
uses: actions/[email protected]

- name: Validate with JSON schema
uses: cardinalby/[email protected]
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.2.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
Loading

0 comments on commit 8a7ba95

Please sign in to comment.