Files
core/.github/workflows/e2e-tests.yml
T

82 lines
2.7 KiB
YAML

name: E2E tests
# yamllint disable-line rule:truthy
on:
workflow_dispatch:
inputs:
version:
description: "Image tag or digest to test (e.g. dev, 2026.7.1, 2026.8.0b0, sha256:0a1b2c3d…)"
default: "dev"
required: true
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.version }}
cancel-in-progress: true
jobs:
boot_check:
name: Boot check ${{ matrix.arch }} core image
if: github.repository_owner == 'home-assistant'
runs-on: ${{ matrix.runs-on }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
runs-on: ubuntu-24.04
- arch: aarch64
runs-on: ubuntu-24.04-arm
env:
BASE_URL: http://localhost:8123
CURL_OPTS: --silent --max-time 10
services:
homeassistant:
image: ghcr.io/home-assistant/home-assistant${{ 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)
options: >-
--health-cmd="curl --fail --silent --max-time 10 --output /dev/null http://127.0.0.1:8123/"
--health-start-period=10s
--health-interval=5s
--health-retries=60
steps:
- name: Check frontend is served
run: |
# Pre-onboarding, / redirects to /onboarding.html; --location follows it
status=$(curl $CURL_OPTS --location --output /dev/null --write-out '%{http_code}' "$BASE_URL/")
if [ "$status" -ne 200 ]; then
echo "::error::Expected HTTP 200 from frontend, got $status"
exit 1
fi
- name: Check onboarding API responds
run: |
curl $CURL_OPTS --fail "$BASE_URL/api/onboarding" \
| jq -e 'type == "array" and length > 0'
- name: Check container is still running
env:
CONTAINER: ${{ job.services.homeassistant.id }}
run: |
if [ "$(docker inspect -f '{{.State.Running}}' "$CONTAINER")" != "true" ]; then
echo "::error::Container is no longer running after checks"
exit 1
fi
- name: Dump container logs
if: always()
env:
CONTAINER: ${{ job.services.homeassistant.id }}
run: docker logs "$CONTAINER" > homeassistant.log 2>&1 || true
- name: Upload container logs
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: container-logs-${{ matrix.arch }}
path: homeassistant.log