mirror of
https://github.com/home-assistant/core.git
synced 2026-08-24 10:13:52 -05:00
Use E2E tests as a publishing gate in builder workflow (#178269)
Co-authored-by: Robert Resch <robert@resch.dev>
This commit is contained in:
co-authored by
Robert Resch
parent
9cb383e43e
commit
88f1a65ad6
@@ -16,6 +16,10 @@ env:
|
||||
# Base image version from https://github.com/home-assistant/docker
|
||||
BASE_IMAGE_VERSION: "2026.07.0"
|
||||
ARCHITECTURES: '["amd64", "aarch64"]'
|
||||
MACHINES: >-
|
||||
["generic-x86-64", "khadas-vim3", "odroid-c2", "odroid-c4", "odroid-m1",
|
||||
"odroid-n2", "qemuarm-64", "qemux86-64", "raspberrypi3-64",
|
||||
"raspberrypi4-64", "raspberrypi5-64", "yellow", "green"]
|
||||
|
||||
permissions: {}
|
||||
|
||||
@@ -35,6 +39,7 @@ jobs:
|
||||
channel: ${{ steps.version.outputs.channel }}
|
||||
publish: ${{ steps.version.outputs.publish }}
|
||||
architectures: ${{ env.ARCHITECTURES }}
|
||||
machines: ${{ env.MACHINES }}
|
||||
base_image_version: ${{ env.BASE_IMAGE_VERSION }}
|
||||
steps:
|
||||
- name: Checkout the repository
|
||||
@@ -218,20 +223,7 @@ jobs:
|
||||
id-token: write # For cosign signing
|
||||
strategy:
|
||||
matrix:
|
||||
machine:
|
||||
- generic-x86-64
|
||||
- khadas-vim3
|
||||
- odroid-c2
|
||||
- odroid-c4
|
||||
- odroid-m1
|
||||
- odroid-n2
|
||||
- qemuarm-64
|
||||
- qemux86-64
|
||||
- raspberrypi3-64
|
||||
- raspberrypi4-64
|
||||
- raspberrypi5-64
|
||||
- yellow
|
||||
- green
|
||||
machine: ${{ fromJson(needs.init.outputs.machines) }}
|
||||
include:
|
||||
# Default: aarch64 on native ARM runner
|
||||
- arch: aarch64
|
||||
@@ -282,11 +274,29 @@ jobs:
|
||||
push: true
|
||||
version: ${{ needs.init.outputs.version }}
|
||||
|
||||
run_e2e_tests_base:
|
||||
name: Run E2E tests on base images
|
||||
if: github.repository_owner == 'home-assistant'
|
||||
needs: ["init", "build_base"]
|
||||
uses: ./.github/workflows/e2e-tests.yml
|
||||
with:
|
||||
version: ${{ needs.init.outputs.version }}
|
||||
image_prefixes: ${{ needs.init.outputs.architectures }}
|
||||
|
||||
run_e2e_tests_machine:
|
||||
name: Run E2E tests on machine images
|
||||
if: github.repository_owner == 'home-assistant'
|
||||
needs: ["init", "build_machine"]
|
||||
uses: ./.github/workflows/e2e-tests.yml
|
||||
with:
|
||||
version: ${{ needs.init.outputs.version }}
|
||||
image_prefixes: ${{ needs.init.outputs.machines }}
|
||||
|
||||
publish_ha:
|
||||
name: Publish version files
|
||||
environment: ${{ needs.init.outputs.channel }}
|
||||
if: github.repository_owner == 'home-assistant'
|
||||
needs: ["init", "build_machine"]
|
||||
needs: ["init", "build_machine", "run_e2e_tests_machine"]
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -326,7 +336,7 @@ jobs:
|
||||
name: Publish to ${{ matrix.registry }}
|
||||
environment: ${{ needs.init.outputs.channel }}
|
||||
if: github.repository_owner == 'home-assistant'
|
||||
needs: ["init", "build_base"]
|
||||
needs: ["init", "build_base", "run_e2e_tests_base"]
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read # To check out the repository
|
||||
@@ -461,7 +471,7 @@ jobs:
|
||||
build_python:
|
||||
name: Build PyPi package
|
||||
environment: ${{ needs.init.outputs.channel }}
|
||||
needs: ["init", "build_base"]
|
||||
needs: ["init", "build_base", "run_e2e_tests_base"]
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read # To check out the repository
|
||||
|
||||
@@ -8,32 +8,48 @@ on:
|
||||
description: "Image tag or digest to test (e.g. dev, 2026.7.1, 2026.8.0b0, sha256:0a1b2c3d…)"
|
||||
default: "dev"
|
||||
required: true
|
||||
image_prefixes:
|
||||
description: "JSON array of image prefixes to test. Will be prefixed to `-homeassistant`"
|
||||
default: >-
|
||||
["generic-x86-64", "khadas-vim3", "odroid-c2", "odroid-c4",
|
||||
"odroid-m1", "odroid-n2", "qemuarm-64", "qemux86-64",
|
||||
"raspberrypi3-64", "raspberrypi4-64", "raspberrypi5-64",
|
||||
"yellow", "green"]
|
||||
required: true
|
||||
workflow_call:
|
||||
inputs:
|
||||
version:
|
||||
description: "Image tag or digest to test (e.g. dev, 2026.7.1, 2026.8.0b0, sha256:0a1b2c3d…)"
|
||||
required: true
|
||||
type: string
|
||||
image_prefixes:
|
||||
description: "JSON array of image prefixes to test. Will be prefixed to `-homeassistant`"
|
||||
required: true
|
||||
type: string
|
||||
|
||||
permissions: {}
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.version }}
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.version }}-${{ inputs.image_prefixes }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
boot_check:
|
||||
name: Boot check ${{ matrix.arch }} core image
|
||||
name: Boot check ${{ matrix.image_prefix }} image
|
||||
if: github.repository_owner == 'home-assistant'
|
||||
runs-on: ${{ matrix.runs-on }}
|
||||
# amd64 images need an x86 runner; all others are aarch64
|
||||
runs-on: ${{ contains(fromJson('["amd64", "generic-x86-64", "qemux86-64"]'), matrix.image_prefix) && 'ubuntu-24.04' || 'ubuntu-24.04-arm' }}
|
||||
timeout-minutes: 20
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- arch: amd64
|
||||
runs-on: ubuntu-24.04
|
||||
- arch: aarch64
|
||||
runs-on: ubuntu-24.04-arm
|
||||
image_prefix: ${{ fromJson(inputs.image_prefixes) }}
|
||||
env:
|
||||
BASE_URL: http://localhost:8123
|
||||
services:
|
||||
homeassistant:
|
||||
image: ghcr.io/home-assistant/home-assistant${{ startsWith(inputs.version, 'sha256:') && '@' || ':' }}${{ inputs.version }} # zizmor: ignore[unpinned-images]
|
||||
# Digests are referenced with '@', tags with ':'
|
||||
image: ghcr.io/home-assistant/${{ matrix.image_prefix }}-homeassistant${{ startsWith(inputs.version, 'sha256:') && '@' || ':' }}${{ inputs.version }} # zizmor: ignore[unpinned-images]
|
||||
ports:
|
||||
- 8123:8123
|
||||
# Gate steps until Home Assistant answers (60 x 5s ≈ 300s startup budget)
|
||||
@@ -76,7 +92,7 @@ jobs:
|
||||
if: always()
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: playwright-report-${{ matrix.arch }}
|
||||
name: playwright-report-${{ matrix.image_prefix }}
|
||||
path: |
|
||||
tests/e2e/playwright-report/
|
||||
tests/e2e/test-results/
|
||||
@@ -91,5 +107,5 @@ jobs:
|
||||
if: always()
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: container-logs-${{ matrix.arch }}
|
||||
name: container-logs-${{ matrix.image_prefix }}
|
||||
path: homeassistant.log
|
||||
|
||||
Reference in New Issue
Block a user