Run tests within build workflow (#2882)

This commit is contained in:
Jan Čermák 2023-10-30 15:42:03 +01:00 committed by GitHub
parent 6d7db27f84
commit ae711734bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 8 deletions

View File

@ -242,6 +242,11 @@ jobs:
path: | path: |
output/images/haos_ova*.qcow2.xz output/images/haos_ova*.qcow2.xz
test:
name: Test OS image
needs: [ build, prepare ]
uses: ./.github/workflows/test.yaml
bump_version: bump_version:
name: Bump ${{ needs.prepare.outputs.channel }} channel version name: Bump ${{ needs.prepare.outputs.channel }} channel version
if: ${{ github.repository == 'home-assistant/operating-system' }} if: ${{ github.repository == 'home-assistant/operating-system' }}

View File

@ -2,6 +2,7 @@ name: Test HAOS image
run-name: "Test HAOS ${{ inputs.version || format('(OS build #{0})', github.event.workflow_run.run_number) }}" run-name: "Test HAOS ${{ inputs.version || format('(OS build #{0})', github.event.workflow_run.run_number) }}"
on: on:
# Manual test of specified version
workflow_dispatch: workflow_dispatch:
inputs: inputs:
version: version:
@ -9,10 +10,8 @@ on:
required: true required: true
type: string type: string
workflow_run: # Called by other workflows (e.g. build.yaml)
workflows: ["OS build"] # must be in sync with build workflow `name` workflow_call:
types:
- completed
jobs: jobs:
test: test:
@ -49,11 +48,9 @@ jobs:
curl -sfL -o haos.qcow2.xz https://os-artifacts.home-assistant.io/${{github.event.inputs.version}}/haos_ova-${{github.event.inputs.version}}.qcow2.xz 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 - name: Get OS image artifact
if: ${{ github.event_name == 'workflow_run' }} if: ${{ github.event_name == 'workflow_call' }}
uses: dawidd6/action-download-artifact@v2 uses: actions/download-artifact@v3
with: with:
workflow: build.yaml
workflow_conclusion: success
name: ova-image name: ova-image
- name: Extract OS image - name: Extract OS image