mirror of
https://github.com/alexhopeoconnor/default.git
synced 2026-10-04 02:58:10 +10:00
Merge CI files (#488)
* test matrix * Add test * Move more to matrix * test * test always * Move HACS away * Combine checks
This commit is contained in:
@@ -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 }}
|
||||
@@ -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 }}
|
||||
@@ -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 }}
|
||||
@@ -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
|
||||
@@ -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 }}"
|
||||
@@ -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"
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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 }}
|
||||
@@ -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 }}
|
||||
@@ -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 }}
|
||||
@@ -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 }}"
|
||||
@@ -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"
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user