From c00faf37d71ae2b54362aef2e0cb6485ebe470ee Mon Sep 17 00:00:00 2001 From: Giorgio Ravera Date: Wed, 7 Jan 2026 18:53:20 +0100 Subject: [PATCH] Enhance CI workflow with version matrix and caching + nightly check --- .github/workflows/homeassistant-ci.yaml | 37 ++++++++++++++++++----- .github/workflows/nightly-check.yaml | 39 +++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/nightly-check.yaml diff --git a/.github/workflows/homeassistant-ci.yaml b/.github/workflows/homeassistant-ci.yaml index f1cddc0e..803a6166 100644 --- a/.github/workflows/homeassistant-ci.yaml +++ b/.github/workflows/homeassistant-ci.yaml @@ -1,8 +1,5 @@ name: Configuration Validation Check -env: - VERSION: stable - on: push: branches: [ "master" ] @@ -21,10 +18,36 @@ jobs: name: Validate Configuration runs-on: ubuntu-latest + strategy: + matrix: + version: [ "stable", "beta" ] + steps: - name: ⤵️ Check out configuration from GitHub uses: actions/checkout@v3 + # --------------------------------------------------------- + # CACHE PIP + # --------------------------------------------------------- + - name: ♻️ Cache pip + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + # --------------------------------------------------------- + # CACHE NPM + # --------------------------------------------------------- + - name: ♻️ Cache npm + uses: actions/cache@v3 + with: + path: ~/.npm + key: ${{ runner.os }}-npm-cache + restore-keys: | + ${{ runner.os }}-npm- + # --------------------------------------------------------- # YAML LINT # --------------------------------------------------------- @@ -34,7 +57,7 @@ jobs: yamllint -c "./.yamllint/rules.yaml" . # --------------------------------------------------------- - # JSON LINT (per i tuoi mapping JSON) + # JSON LINT # --------------------------------------------------------- - name: 🔍 JSON Lint run: | @@ -81,20 +104,20 @@ jobs: # --------------------------------------------------------- - name: ⤵️ Fetch Home Assistant Docker Image run: | - docker pull -q "ghcr.io/home-assistant/home-assistant:$VERSION" + docker pull -q "ghcr.io/home-assistant/home-assistant:${{ matrix.version }}" - name: 🚀 Run Home Assistant Configuration Check run: | # Show Version docker run --rm \ -v .:/config \ - "ghcr.io/home-assistant/home-assistant:$VERSION" \ + "ghcr.io/home-assistant/home-assistant:${{ matrix.version }}" \ python -m homeassistant --version # Run check_config docker run --rm \ -v .:/config \ - "ghcr.io/home-assistant/home-assistant:$VERSION" \ + "ghcr.io/home-assistant/home-assistant:${{ matrix.version }}" \ python -m homeassistant \ --config "/config" \ --script check_config diff --git a/.github/workflows/nightly-check.yaml b/.github/workflows/nightly-check.yaml new file mode 100644 index 00000000..ff45fe26 --- /dev/null +++ b/.github/workflows/nightly-check.yaml @@ -0,0 +1,39 @@ +name: Nightly Configuration Check + +on: + schedule: + - cron: "0 3 * * *" + +permissions: + contents: read + +jobs: + nightly: + name: Nightly HA Config Check + runs-on: ubuntu-latest + + strategy: + matrix: + version: [ "stable", "beta" ] + + steps: + - name: ⤵️ Checkout + uses: actions/checkout@v3 + + - name: 🔑 Dummy secrets + run: | + cp .secrets_dummy.yaml secrets.yaml + cp credentials/.google_dummy.json credentials/google.json + + - name: ⤵️ Fetch Home Assistant Docker Image + run: | + docker pull -q "ghcr.io/home-assistant/home-assistant:${{ matrix.version }}" + + - name: 🚀 Run Home Assistant Configuration Check + run: | + docker run --rm \ + -v .:/config \ + "ghcr.io/home-assistant/home-assistant:${{ matrix.version }}" \ + python -m homeassistant \ + --config "/config" \ + --script check_config -- 2.47.3