-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 dezihh-patch-1
- Loading branch information
Showing
10 changed files
with
106 additions
and
90 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
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,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 | ||
|
@@ -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 | ||
|
@@ -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}} |
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,7 +17,7 @@ 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 | ||
|
@@ -27,7 +27,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/[email protected].1 | ||
uses: actions/[email protected].7 | ||
|
||
- name: Critical | ||
uses: cardinalby/[email protected] | ||
|
@@ -52,7 +52,7 @@ jobs: | |
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 |
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,7 +18,7 @@ jobs: | |
name: Upload | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/[email protected].1 | ||
uses: actions/[email protected].7 | ||
|
||
- name: Validate with JSON schema | ||
uses: cardinalby/[email protected] | ||
|
@@ -27,7 +27,7 @@ jobs: | |
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" | ||
|
@@ -46,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,7 +18,7 @@ jobs: | |
name: Upload | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/[email protected].1 | ||
uses: actions/[email protected].7 | ||
|
||
- name: Validate with JSON schema | ||
uses: cardinalby/[email protected] | ||
|
@@ -27,7 +27,7 @@ jobs: | |
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" | ||
|
@@ -46,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
Oops, something went wrong.