-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into leeds_bins
- Loading branch information
Showing
18 changed files
with
755 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
name: "Checks" | ||
name: Check | ||
|
||
on: | ||
pull_request: | ||
types: | ||
|
@@ -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/[email protected] | ||
uses: actions/[email protected] | ||
|
||
- name: Set up Python | ||
uses: actions/[email protected] | ||
with: | ||
python-version-file: ".python-version" | ||
|
||
- name: Clone origin | ||
run: git clone --depth 1 https://github.com/hacs/default /tmp/repositories/default | ||
|
@@ -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/[email protected] | ||
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 | ||
|
@@ -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/[email protected] | ||
uses: actions/[email protected] | ||
|
||
- name: Set up Python | ||
uses: actions/[email protected] | ||
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/[email protected] | ||
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/[email protected] | ||
|
||
- 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}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[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] | ||
uses: actions/[email protected] | ||
|
||
- name: Set up Python | ||
uses: actions/[email protected] | ||
with: | ||
python-version-file: ".python-version" | ||
|
||
- name: Check lists | ||
run: python3 scripts/is_sorted.py | ||
run: python3 scripts/is_sorted.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,20 +18,26 @@ 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.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 | ||
awscli==1.36.39 | ||
- name: Handle the critical file | ||
run: | | ||
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,20 +18,26 @@ 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.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 | ||
awscli==1.36.39 | ||
- name: Handle the removed file | ||
run: | | ||
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.