Skip to content

Check hacs.json before downloading #3454

Check hacs.json before downloading

Check hacs.json before downloading #3454

Workflow file for this run

name: Validate
on:
pull_request:
branches:
- main
push:
branches:
- main
schedule:
- cron: "0 0 * * *"
concurrency:
group: validate-${{ github.ref }}
cancel-in-progress: true
jobs:
validate-hassfest:
runs-on: ubuntu-latest
name: With hassfest
steps:
- name: 📥 Checkout the repository
uses: actions/checkout@v4.1.1
- name: 🏃 Hassfest validation
uses: "home-assistant/actions/hassfest@master"
- name: 📨 Discord notification
if: ${{ github.event_name == 'schedule' && failure() }}
run: |
curl \
-H "Content-Type: application/json" \
-d '{"username": "GitHub action failure", "content": "[Scheduled action failed!](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}})"}' \
${{ secrets.DISCORD_WEBHOOK_ACTION_FAILURE }}
validate-hacs:
runs-on: ubuntu-latest
name: With HACS Action
steps:
- name: 🏃 HACS validation
uses: hacs/action@main
with:
category: integration
- name: 📨 Discord notification
if: ${{ github.event_name == 'schedule' && failure() }}
run: |
curl \
-H "Content-Type: application/json" \
-d '{"username": "GitHub action failure", "content": "[Scheduled action failed!](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}})"}' \
${{ secrets.DISCORD_WEBHOOK_ACTION_FAILURE }}
validata-hacs-data:
runs-on: ubuntu-latest
name: Validate HACS data generation
steps:
- name: Checkout the repository
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v4.1.1
- name: Set up Python
if: ${{ github.event_name == 'push' }}
uses: actions/setup-python@v4.7.1
id: python
with:
python-version: "3.11"
cache: 'pip'
cache-dependency-path: |
requirements_base.txt
requirements_generate_data.txt
- name: Install dependencies
if: ${{ github.event_name == 'push' }}
run: |
scripts/install/frontend
scripts/install/pip_packages --requirement requirements_generate_data.txt
- name: Generate data
if: ${{ github.event_name == 'push' }}
run: python3 -m scripts.data.generate_category_data integration hacs/integration
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Validate output with JQ
if: ${{ github.event_name == 'push' }}
run: |
jq -c . outputdata/integration/data.json
jq -c . outputdata/integration/repositories.json
validate-homeassistant:
name: With Home Assistant
strategy:
matrix:
channel: [stable, beta, dev, "2023.6.0"]
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout the repository
uses: actions/checkout@v4.1.1
- name: 📋 Copy sample configuration for Home Assistant
run: |
mkdir ./test_configuration
bash scripts/install/frontend
cp -r ./custom_components ./test_configuration
echo "default_config:" >> ./test_configuration/configuration.yaml
echo "hacs:" >> ./test_configuration/configuration.yaml
echo " token: CHANGE_ME" >> ./test_configuration/configuration.yaml
- name: 🛠️ Setup Home Assistant
id: homeassistant
uses: ludeeus/setup-homeassistant@main
with:
tag: ${{ matrix.channel }}
config-dir: test_configuration
- name: 📨 Discord notification
if: ${{ github.event_name == 'schedule' && failure() }}
run: |
curl \
-H "Content-Type: application/json" \
-d '{"username": "GitHub action failure", "content": "[Scheduled action failed!](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}})"}' \
${{ secrets.DISCORD_WEBHOOK_ACTION_FAILURE }}