spiegel_podman/.github/workflows/lima.yml
Paul Holzinger 66c6da6e84
re-enable logformatter and post failure summary
Adapt the logformatter script to run again to produce nicely formatted
html logs. Because github cannot upload and show raw html files we can
only add it to the log archive which must be downloaded and viewed
locally.

To improve the online experience however github does have the
GITHUB_STEP_SUMMARY logic which allows us to produce markdown which will
be shown on the summary page for a given test run.

The problem is even though github markdown supports some html is does
not support CSS and out custom style of the logformatter, in addition
the output size is limited so I wrote another script parsing the html
output again and turning it into plain test for only the failed tests
and then show this as plain text inside codeblocks in the markdown.

With this we have a short failure summary which should display all
failures at once in the run page so maintainers can see if the failed
log was just some flake or an actual problem with the PR.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-07-29 14:49:23 +02:00

96 lines
3.4 KiB
YAML

name: lima
on:
workflow_call:
inputs:
distro:
required: true
type: string
test:
required: true
type: string
priv:
required: false
type: string
mode:
required: false
type: string
runner:
required: true
type: string
timeout:
required: false
type: number
if:
required: false
type: boolean
default: true
permissions: {}
env:
# CI automation repo release for the VM image downloads in ci.sh.
# ENV is managed by renovate, do not change the name without
# updating the renovate config in the automation repo.
AUTOMATION_RELEASE: 20260722t094115z
# Needed for logformatter
PR_NUMBER: ${{ github.event.pull_request.number || '' }}
PR_TITLE: ${{ github.event.pull_request.title || '' }}
GITHUB_RUN_ID: ${{ github.run_id }}
jobs:
lima:
if: ${{ inputs.if }}
name: lima # main name is set by who spawns this job
runs-on: ${{ inputs.runner }}
timeout-minutes: ${{ inputs.timeout || 20 }} # default to 20m timeout if non specified
permissions: {}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# TODO: figure out how to cache the binaries from the build job to the actual test tasks
# - name: Download binaries
# if: ${{ inputs.test != 'build' }} # Download build binaries for tests to not compile them again.
# uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
# with:
# name: "binaries-${{ inputs.distro }}"
# path: bin/
- uses: lima-vm/lima-actions/setup@55627e31b78637bf254a8b2a14da8ea7d12564e5 # v1.1.0
id: lima
with:
version: v2.1.1
# NOTE, we are not using a cache here as documented in the lima action.
# This is because our VM images are above 5GB and the total github limit is 10 GB which means
# it will clean out the other image basically right away making the cache useless for other tasks.
# Also most importantly while testing it the cache was slower, the VM images are hosted in the
# oracle cloud bucket which is already local to the oracle CI runners unlike the cache which is
# stored by github somewhere else.
- name: Run test on lima
run: | # zizmor: ignore[template-injection]
./hack/ci/ci.sh ${{ inputs.test }} ${{ inputs.mode }} ${{ inputs.priv }} ${{ inputs.distro }}
- name: Output failure log as GITHUB_STEP_SUMMARY
if: failure()
run: hack/ci/github_log_summary.py hack/ci/logs/*.html > $GITHUB_STEP_SUMMARY || true
# TODO: figure out how to cache the binaries from the build job to the actual test tasks
# - name: Upload binaries as artifact
# if: ${{ inputs.test == 'build' }}
# uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
# with:
# name: "binaries-${{ inputs.distro }}"
# path: "bin/"
# if-no-files-found: error
- name: Upload journal as artifact
if: always() # always collect the log
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
with:
name: "${{ inputs.test }}-${{ inputs.mode }}-${{ inputs.priv }}-${{ inputs.distro }}.logs"
path: "./hack/ci/logs/*"
if-no-files-found: ignore