1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
|
---
name: Manual test
on: # yamllint disable-line rule:truthy
workflow_dispatch:
inputs:
test:
description: "Array of tests to run, such as [11,12]"
default: "[]"
container:
type: choice
description: 'distro'
default: 'all'
options:
- "all"
- "alpine:latest"
- "alpine:edge"
- "azurelinux:3.0"
- "centos:stream10-development"
- "fedora:latest"
- "fedora:rawhide"
- "arch:latest"
- "debian:latest"
- "debian:sid"
- "ubuntu:devel"
- "ubuntu:rolling"
- "opensuse:latest"
- "gentoo:latest"
- "void:latest"
env:
description: 'Environment (optional)'
default: '{"DEBUGFAIL": "rd.debug"}'
registry:
description: 'Registry for containers, such as ghcr.io/dracut-ng'
env:
${{ fromJSON(inputs.env) }}
jobs:
matrix:
runs-on: ubuntu-24.04
outputs:
registry: ${{ steps.set-matrix.outputs.registry }}
container: ${{ steps.set-matrix.outputs.container }}
tests: ${{ steps.set-matrix.outputs.tests }}
steps:
- name: "Checkout Repository"
uses: actions/checkout@v5
with:
fetch-depth: 0
- id: set-matrix
name: "Set Matrix"
run: |
[[ "${{ inputs.registry }}" != '' ]] && echo "registry=\"${{ inputs.registry }}\"" >> $GITHUB_OUTPUT \
|| ( echo "registry=\"ghcr.io/${{ github.repository_owner }}\"" >> $GITHUB_OUTPUT )
[[ "${{ inputs.container }}" != 'all' ]] && echo "container=[\"${{ inputs.container }}\"]" >> $GITHUB_OUTPUT \
|| ( containers=$(find test/container -name "Dockerfile-*" | cut -d\- -f2 | tr '[:upper:]' '[:lower:]' | sed -z 's/\n/","/g'); echo "container=[\"${containers%??}]" >> $GITHUB_OUTPUT )
[[ "${{ toJson(fromJson(inputs.test)) }}" != '[]' ]] && echo "tests=${{ inputs.test }}" >> $GITHUB_OUTPUT \
|| ( tests=$(find test -type d -a -name "TEST-*" | cut -d\- -f2 | sed -z 's/\n/","/g' ); echo "tests=[\"${tests%??}]" >> $GITHUB_OUTPUT )
test:
needs: matrix
runs-on: ubuntu-24.04
timeout-minutes: 20
concurrency:
group: manual-${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }}
cancel-in-progress: true
strategy:
matrix:
container: ${{ fromJSON(needs.matrix.outputs.container) }}
test: ${{ fromJSON(needs.matrix.outputs.tests) }}
fail-fast: false
container:
image: ${{ fromJSON(needs.matrix.outputs.registry) }}/${{ matrix.container }}-amd
options: "--privileged -v /dev:/dev"
steps:
- name: "Checkout Repository"
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: "${{ matrix.container }} ${{ matrix.test }}"
run: ./test/test-container.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}
|