diff --git a/.github/workflows/check-archived.yml b/.github/workflows/check-archived.yml deleted file mode 100644 index 60d5ec5..0000000 --- a/.github/workflows/check-archived.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: "Check Archived" -on: [pull_request] - -jobs: - check: - runs-on: ubuntu-latest - name: "Check Archived" - steps: - - name: Check out repository - uses: actions/checkout@v2 - - - name: Clone origin - run: git clone --depth 1 https://github.com/hacs/default /tmp/default - - - name: Clone new addition - run: | - repo=$(python3 -m scripts.changed.repo) - git clone --depth 1 "https://github.com/$repo" /tmp/addition - - - name: Install dependencies - run: | - python3 -m pip install setuptools wheel - python3 -m pip install aiogithubapi - - - name: Check archived - run: python3 -m scripts.check.archived - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/check-brands.yml b/.github/workflows/check-brands.yml deleted file mode 100644 index 90cebc9..0000000 --- a/.github/workflows/check-brands.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: "Check Brands" -on: [pull_request] - -jobs: - check: - runs-on: ubuntu-latest - name: "Check Brands" - steps: - - name: Check out repository - uses: actions/checkout@v2 - - - name: Clone origin - run: git clone --depth 1 https://github.com/hacs/default /tmp/default - - - name: Clone new addition - run: | - repo=$(python3 -m scripts.changed.repo) - git clone --depth 1 "https://github.com/$repo" /tmp/addition - - - name: Set category - id: category - run: echo "::set-output name=category::$(python3 -m scripts.changed.category)" - - - name: Install dependencies - if: steps.category.outputs.category == 'integration' - run: | - python3 -m pip install setuptools wheel - python3 -m pip install aiogithubapi - - - name: Check home-assistant/brands - if: steps.category.outputs.category == 'integration' - run: python3 -m scripts.check.brands - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/check-fork.yml b/.github/workflows/check-fork.yml deleted file mode 100644 index 371523f..0000000 --- a/.github/workflows/check-fork.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: "Check Fork" -on: [pull_request] - -jobs: - check: - runs-on: ubuntu-latest - name: "Check Fork" - steps: - - name: Check out repository - uses: actions/checkout@v2 - - - name: Clone origin - run: git clone --depth 1 https://github.com/hacs/default /tmp/default - - - name: Clone new addition - run: | - repo=$(python3 -m scripts.changed.repo) - git clone --depth 1 "https://github.com/$repo" /tmp/addition - - - name: Install dependencies - run: | - python3 -m pip install setuptools wheel - python3 -m pip install aiogithubapi - - - name: Check fork - run: python3 -m scripts.check.fork - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/check-hacs-manifest.yml b/.github/workflows/check-hacs-manifest.yml deleted file mode 100644 index 8c43554..0000000 --- a/.github/workflows/check-hacs-manifest.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: "Check HACS Manifest" -on: [pull_request] - -jobs: - check: - runs-on: ubuntu-latest - name: "Check HACS Manifest" - steps: - - name: Check out repository - uses: actions/checkout@v2 - - - name: Clone origin - run: git clone --depth 1 https://github.com/hacs/default /tmp/default - - - name: Clone new addition - run: | - repo=$(python3 -m scripts.changed.repo) - git clone --depth 1 "https://github.com/$repo" /tmp/addition - - - name: Check HACS manifest - run: python3 -m scripts.check.hacs_manifest diff --git a/.github/workflows/check-hacs.yaml b/.github/workflows/check-hacs.yaml deleted file mode 100644 index fd7c4e3..0000000 --- a/.github/workflows/check-hacs.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: "Check HACS" -on: [pull_request] - -jobs: - check: - runs-on: ubuntu-latest - name: "Check HACS" - steps: - - name: Check out repository - uses: actions/checkout@v2 - - - name: Clone origin - run: git clone --depth 1 https://github.com/hacs/default /tmp/default - - - name: Set category - id: category - run: echo "::set-output name=category::$(python3 -m scripts.changed.category)" - - - name: Set repository - id: repository - run: echo "::set-output name=repository::$(python3 -m scripts.changed.repo)" - - - name: HACS validation - uses: "hacs/integration/action@master" - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - env: - REPOSITORY: "${{ steps.repository.outputs.repository }}" - CATEGORY: "${{ steps.category.outputs.category }}" \ No newline at end of file diff --git a/.github/workflows/check-hassfest.yml b/.github/workflows/check-hassfest.yml deleted file mode 100644 index 43f9277..0000000 --- a/.github/workflows/check-hassfest.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: "Check hassfest" -on: [pull_request] - -jobs: - check: - runs-on: ubuntu-latest - name: "Check hassfest" - steps: - - name: Check out repository - uses: actions/checkout@v2 - - - name: Clone origin - run: git clone --depth 1 https://github.com/hacs/default /tmp/default - - - name: Clone new addition - run: | - repo=$(python3 -m scripts.changed.repo) - git clone --depth 1 "https://github.com/$repo" /tmp/addition - - - name: Set category - id: category - run: echo "::set-output name=category::$(python3 -m scripts.changed.category)" - - - name: Pull Home Assistant Container - if: steps.category.outputs.category == 'integration' - run: docker pull homeassistant/home-assistant:beta - - - name: Run hassfest - if: steps.category.outputs.category == 'integration' - run: | - integration=$(python3 -m scripts.helpers.integration_path) - domain=$(python3 -m scripts.helpers.domain) - docker run --entrypoint="" -v "$integration":"/$domain" \ - homeassistant/home-assistant:beta python3 -m \ - script.hassfest --action validate --integration-path "/$domain" \ No newline at end of file diff --git a/.github/workflows/check-images.yml b/.github/workflows/check-images.yml deleted file mode 100644 index 2fafe3f..0000000 --- a/.github/workflows/check-images.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: "Check Images" -on: [pull_request] - -jobs: - check: - runs-on: ubuntu-latest - name: "Check Images" - steps: - - name: Check out repository - uses: actions/checkout@v2 - - - name: Clone origin - run: git clone --depth 1 https://github.com/hacs/default /tmp/default - - - name: Clone new addition - run: | - repo=$(python3 -m scripts.changed.repo) - git clone --depth 1 "https://github.com/$repo" /tmp/addition - - - name: Check images - run: python3 -m scripts.check.images diff --git a/.github/workflows/check-info.yml b/.github/workflows/check-info.yml deleted file mode 100644 index bd1a8de..0000000 --- a/.github/workflows/check-info.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: "Check Info" -on: [pull_request] - -jobs: - check: - runs-on: ubuntu-latest - name: "Check Info" - steps: - - name: Check out repository - uses: actions/checkout@v2 - - - name: Clone origin - run: git clone --depth 1 https://github.com/hacs/default /tmp/default - - - name: Clone new addition - run: | - repo=$(python3 -m scripts.changed.repo) - git clone --depth 1 "https://github.com/$repo" /tmp/addition - - - name: Check info - run: python3 -m scripts.check.info diff --git a/.github/workflows/check-manifest.yml b/.github/workflows/check-manifest.yml deleted file mode 100644 index 25903eb..0000000 --- a/.github/workflows/check-manifest.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: "Check Manifest" -on: [pull_request] - -jobs: - check: - runs-on: ubuntu-latest - name: "Check Manifest" - steps: - - name: Check out repository - uses: actions/checkout@v2 - - - name: Clone origin - run: git clone --depth 1 https://github.com/hacs/default /tmp/default - - - name: Clone new addition - run: | - repo=$(python3 -m scripts.changed.repo) - git clone --depth 1 "https://github.com/$repo" /tmp/addition - - - name: Set category - id: category - run: echo "::set-output name=category::$(python3 -m scripts.changed.category)" - - - name: Check manifest - if: steps.category.outputs.category == 'integration' - run: python3 -m scripts.check.manifest diff --git a/.github/workflows/check-owner.yml b/.github/workflows/check-owner.yml deleted file mode 100644 index df948d2..0000000 --- a/.github/workflows/check-owner.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: "Check Owner" -on: [pull_request] - -jobs: - check: - runs-on: ubuntu-latest - name: "Check Owner" - steps: - - name: Check out repository - uses: actions/checkout@v2 - - - name: Clone origin - run: git clone --depth 1 https://github.com/hacs/default /tmp/default - - - name: Clone new addition - run: | - repo=$(python3 -m scripts.changed.repo) - git clone --depth 1 "https://github.com/$repo" /tmp/addition - - - name: Install dependencies - run: | - python3 -m pip install setuptools wheel - python3 -m pip install aiogithubapi - - - name: Check owner - run: python3 -m scripts.check.owner - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/check-repository.yml b/.github/workflows/check-repository.yml deleted file mode 100644 index 000da3d..0000000 --- a/.github/workflows/check-repository.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: "Check Repository" -on: [pull_request] - -jobs: - check: - runs-on: ubuntu-latest - name: "Check Repository" - steps: - - name: Check out repository - uses: actions/checkout@v2 - - - name: Clone origin - run: git clone --depth 1 https://github.com/hacs/default /tmp/default - - - name: Clone new addition - run: | - repo=$(python3 -m scripts.changed.repo) - git clone --depth 1 "https://github.com/$repo" /tmp/addition - - - name: Install dependencies - run: | - python3 -m pip install setuptools wheel - python3 -m pip install aiogithubapi - - - name: Check repository - run: python3 -m scripts.check.repository - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/check-wheels.yml b/.github/workflows/check-wheels.yml deleted file mode 100644 index be9203f..0000000 --- a/.github/workflows/check-wheels.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: "Check Wheels" -on: [pull_request] - -jobs: - check: - runs-on: ubuntu-latest - name: "Check Wheels" - steps: - - name: Check out repository - uses: actions/checkout@v2 - - - name: Clone origin - run: git clone --depth 1 https://github.com/hacs/default /tmp/default - - - name: Clone new addition - run: | - repo=$(python3 -m scripts.changed.repo) - git clone --depth 1 "https://github.com/$repo" /tmp/addition - - - name: Set category - id: category - run: echo "::set-output name=category::$(python3 -m scripts.changed.category)" - - - name: Install dependencies - if: steps.category.outputs.category == 'integration' - run: | - python3 -m pip install setuptools wheel - python3 -m pip install aiogithubapi - - - name: Check home-assistant/wheels-custom-integrations - if: steps.category.outputs.category == 'integration' - run: python3 -m scripts.check.wheels - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 0000000..2a1536f --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,103 @@ +name: "Checks" +on: [pull_request] + +jobs: + matrix: + runs-on: ubuntu-latest + name: ${{ matrix.checks.name }} + if: ${{ always() }} + strategy: + matrix: + checks: + - {check: "archived", name: "Check Archived", deps: True} + - {check: "brands", name: "Check Brands", deps: True} + - {check: "fork", name: "Check Fork", deps: True} + - {check: "hacs_manifest", name: "Check HACS Manifest"} + - {check: "images", name: "Check Images"} + - {check: "info", name: "Check Info"} + - {check: "manifest", name: "Check Manifest"} + - {check: "owner", name: "Check Owner", deps: True} + - {check: "repository", name: "Check Repository", deps: True} + - {check: "wheels", name: "Check Wheels", deps: True} + steps: + - name: Check out repository + uses: actions/checkout@v2 + + - name: Clone origin + run: git clone --depth 1 https://github.com/hacs/default /tmp/default + + - name: Clone new addition + run: | + repo=$(python3 -m scripts.changed.repo) + git clone --depth 1 "https://github.com/$repo" /tmp/addition + + - name: Install dependencies if needed + if: matrix.checks.deps + run: | + python3 -m pip install setuptools wheel + python3 -m pip install aiogithubapi + + - name: Run the check + run: python3 -m scripts.check.${{ matrix.checks.check }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + hassfest: + runs-on: ubuntu-latest + name: "Check hassfest" + if: ${{ always() }} + steps: + - name: Check out repository + uses: actions/checkout@v2 + + - name: Clone origin + run: git clone --depth 1 https://github.com/hacs/default /tmp/default + + - name: Clone new addition + run: | + repo=$(python3 -m scripts.changed.repo) + git clone --depth 1 "https://github.com/$repo" /tmp/addition + + - name: Set category + id: category + run: echo "::set-output name=category::$(python3 -m scripts.changed.category)" + + - name: Pull Home Assistant Container + if: steps.category.outputs.category == 'integration' + run: docker pull homeassistant/home-assistant:beta + + - name: Run hassfest + if: steps.category.outputs.category == 'integration' + run: | + integration=$(python3 -m scripts.helpers.integration_path) + domain=$(python3 -m scripts.helpers.domain) + docker run --entrypoint="" -v "$integration":"/$domain" \ + homeassistant/home-assistant:beta python3 -m \ + script.hassfest --action validate --integration-path "/$domain" + + hacs: + runs-on: ubuntu-latest + name: "Check HACS" + if: ${{ always() }} + steps: + - name: Check out repository + uses: actions/checkout@v2 + + - name: Clone origin + run: git clone --depth 1 https://github.com/hacs/default /tmp/default + + - name: Set category + id: category + run: echo "::set-output name=category::$(python3 -m scripts.changed.category)" + + - name: Set repository + id: repository + run: echo "::set-output name=repository::$(python3 -m scripts.changed.repo)" + + - name: HACS validation + uses: "hacs/integration/action@master" + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + env: + REPOSITORY: "${{ steps.repository.outputs.repository }}" + CATEGORY: "${{ steps.category.outputs.category }}" \ No newline at end of file diff --git a/.github/workflows/lint-jq.yml b/.github/workflows/lint-jq.yml deleted file mode 100644 index 1a5aae7..0000000 --- a/.github/workflows/lint-jq.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Lint [jq] -on: [push, pull_request] - -jobs: - push: - name: Lint with jq - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - - name: Validate appdaemon - run: jq --raw-output "." "appdaemon" - - - name: Validate blacklist - run: jq --raw-output "." "blacklist" - - - name: Validate critical - run: jq --raw-output "." "critical" - - - name: Validate integration - run: jq --raw-output "." "integration" - - - name: Validate netdaemon - run: jq --raw-output "." "netdaemon" - - - name: Validate plugin - run: jq --raw-output "." "plugin" - - - name: Validate python_script - run: jq --raw-output "." "python_script" - - - name: Validate removed - run: jq --raw-output "." "removed" - - - name: Validate theme - run: jq --raw-output "." "theme" \ No newline at end of file diff --git a/.github/workflows/lint-sorted.yml b/.github/workflows/lint-sorted.yml deleted file mode 100644 index bceccb7..0000000 --- a/.github/workflows/lint-sorted.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Lint [sorted] -on: [push, pull_request] - -jobs: - push: - name: Make sure lists is sorted - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - - name: Check lists - run: python3 scripts/is_sorted.py \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..9be7e42 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,24 @@ +name: Lint +on: [push, pull_request] + +jobs: + jq: + name: JQ + if: ${{ always() }} + runs-on: ubuntu-latest + strategy: + matrix: + checks: [appdaemon, blacklist, critical, integration, netdaemon, plugin, python_script, removed, theme] + steps: + - uses: actions/checkout@v2 + - name: Validate ${{ matrix.checks }} + run: jq --raw-output "." "${{ matrix.checks }}" + + sorted: + name: Sorted + if: ${{ always() }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Check lists + run: python3 scripts/is_sorted.py \ No newline at end of file