From 71d222ad91f8c651c7a640ff8530fff7b7fec5d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C4=8Cerm=C3=A1k?= Date: Thu, 21 Aug 2025 00:19:48 +0200 Subject: [PATCH] Add checkbox for running test in GH build workflow (#4246) Currently when we run a build with limited set of boards that doesn't include OVA, the test job fails because the OVA artifact is missing. Add a checkbox for running tests and ensure that OVA artifact is built if it's enabled. --- .github/workflows/build.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a45439fc7..82a4be82c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -16,6 +16,11 @@ on: required: true type: boolean default: true + run_tests: + description: 'Run tests after build' + required: true + type: boolean + default: true hassio_channel: description: 'Release channel to use (default: stable for GH releases, dev otherwise)' type: choice @@ -152,12 +157,21 @@ jobs: } const boardFilter = "${{ github.event.inputs.boards }}" + const runTests = "${{ github.event.inputs.run_tests }}" === "true" + if (boardFilter == "") { console.log("Run full build for all boards") return { "board": boards } } else { console.log("Run partial build") const boardSet = new Set(boardFilter.split(",")) + + // if tests are enabled, we need to ensure the OVA board is included + if (runTests && !boardSet.has("ova")) { + console.log("Adding OVA board for integration tests") + boardSet.add("ova") + } + const buildBoards = boards.filter(b => boardSet.has(b.id)) return { "board": buildBoards } } @@ -410,6 +424,7 @@ jobs: test: name: Test OS image + if: ${{ github.event_name == 'release' || inputs.run_tests == true }} needs: [ build, prepare ] uses: ./.github/workflows/test.yaml with: