mirror of
https://github.com/home-assistant/operating-system.git
synced 2026-07-06 22:45:05 +01:00
edc508af6d
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.2 to 6.0.3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/de0fac2e4500dabe0009e67214ff5f5447ce83dd...df4cb1c069e1874edd31b4311f1884172cec0e10) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 6.0.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
102 lines
3.2 KiB
YAML
102 lines
3.2 KiB
YAML
name: Test HAOS image
|
|
run-name: "Test HAOS ${{ inputs.version || format('(OS build #{0})', github.event.workflow_run.run_number) }}"
|
|
|
|
on:
|
|
# Manual test of specified version
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: Version of HAOS to test
|
|
required: true
|
|
type: string
|
|
|
|
# Called by other workflows (e.g. build.yaml)
|
|
workflow_call:
|
|
inputs:
|
|
use-artifact:
|
|
# Workaround for GH weirdness: https://github.com/actions/runner/discussions/1884
|
|
description: Download OS image using actions/download-artifact
|
|
required: false
|
|
type: boolean
|
|
default: true
|
|
version:
|
|
description: Version of HAOS to test (as used in the name of the qcow2 image artifact)
|
|
required: true
|
|
type: string
|
|
|
|
jobs:
|
|
test:
|
|
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
|
|
|
|
name: Test in QEMU
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Checkout source
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Install system dependencies
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y qemu-system-x86 ovmf
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
with:
|
|
python-version: 3.12
|
|
|
|
- name: Install Python requirements
|
|
run:
|
|
pip install -r tests/requirements.txt
|
|
|
|
- name: Download HAOS image
|
|
if: ${{ !inputs.use-artifact }}
|
|
run: |
|
|
curl -sfL -o haos.qcow2.xz https://os-artifacts.home-assistant.io/${{github.event.inputs.version}}/haos_ova-${{github.event.inputs.version}}.qcow2.xz
|
|
|
|
- name: Get OS image artifact
|
|
if: ${{ inputs.use-artifact }}
|
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
with:
|
|
name: haos_ova-${{ inputs.version }}.qcow2.xz
|
|
|
|
- name: Extract OS image
|
|
run: |
|
|
xz -dc haos*.qcow2.xz > tests/haos.qcow2
|
|
rm haos*.qcow2.xz
|
|
|
|
- name: Enable KVM group perms
|
|
run: |
|
|
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
|
sudo udevadm control --reload-rules
|
|
sudo udevadm trigger --name-match=kvm
|
|
|
|
- name: Run tests
|
|
run: |
|
|
./tests/run_tests.sh --durations=0 --durations-min=5.0
|
|
|
|
- name: Archive logs
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
if: always()
|
|
with:
|
|
name: logs
|
|
path: |
|
|
tests/lg_logs/**
|
|
|
|
- name: Archive JUnit reports
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
if: always()
|
|
with:
|
|
name: junit_reports
|
|
path: |
|
|
tests/junit_reports/*.xml
|
|
|
|
- name: Publish test report
|
|
uses: mikepenz/action-junit-report@3a81627bfac62268172037048872e8ebd4207e6d # v6.4.1
|
|
if: always()
|
|
with:
|
|
report_paths: 'tests/junit_reports/*.xml'
|
|
annotate_only: true
|
|
detailed_summary: true
|