]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Enhance CI workflow with version matrix and caching + nightly check
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Wed, 7 Jan 2026 17:53:20 +0000 (18:53 +0100)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Wed, 7 Jan 2026 17:53:20 +0000 (18:53 +0100)
.github/workflows/homeassistant-ci.yaml
.github/workflows/nightly-check.yaml [new file with mode: 0644]

index f1cddc0e6837b9f618993946b8f8d987e0441fc8..803a6166a6cbe75f43b7cc6f88d2df372cff071d 100644 (file)
@@ -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 (file)
index 0000000..ff45fe2
--- /dev/null
@@ -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