-
Notifications
You must be signed in to change notification settings - Fork 259
69 lines (66 loc) · 2.37 KB
/
run-partial-tests.yaml
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
name: tests/run-partial-tests.sh
on:
schedule:
- cron: '42 3 1,15 * *'
workflow_dispatch:
inputs:
full:
description: Full set of tests
required: true
type: boolean
default: false
os:
description: OS / Dockerfile
type: string
docker:
description: docker or podman
type: choice
options:
- docker
- podman
jobs:
gen-matrix:
runs-on: ubuntu-22.04
timeout-minutes: 5
outputs:
matrix: ${{ steps.dispatch-matrix.outputs.matrix }}${{ steps.default-matrix.outputs.matrix }}
steps:
- id: default-matrix
run: |
(
echo -n "matrix={'os': [ 'fedora-rawhide', 'fedora-40', 'fedora-39', 'centos-9-stream', 'rocky-9', 'rocky-8', 'almalinux-9', 'almalinux-8' ], \
'docker': [ 'docker', 'podman' ] "
if [ -n "${{ secrets.REDHAT_ORG }}" -a -n "${{ secrets.REDHAT_ACTIVATIONKEY }}" ] ; then
echo -n ", 'include': [ \
{ 'os': 'rhel-9', 'docker': 'podman' }, \
{ 'os': 'rhel-8', 'docker': 'podman' } \
]"
fi
echo "}" ) | tee -a $GITHUB_OUTPUT
if: github.event_name != 'workflow_dispatch' || inputs.full
- id: dispatch-matrix
run: |
echo "matrix={'os': [ '${{ inputs.os }}' ], 'docker': [ '${{ inputs.docker }}' ]}" | tee -a $GITHUB_OUTPUT
if: github.event_name == 'workflow_dispatch' && ! inputs.full
test:
runs-on: ${{ matrix.runs-on || 'ubuntu-22.04' }}
needs: [ gen-matrix ]
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.gen-matrix.outputs.matrix) }}
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Install podman 4.*
uses: ./.github/actions/install-podman-4
if: matrix.docker == 'podman' && matrix.runs-on != 'ubuntu-20.04'
- uses: ./.github/actions/docker-cgroups-ubuntu-22
if: matrix.docker == 'docker' && matrix.runs-on != 'ubuntu-20.04'
- name: For RHEL builds, use entitlements
if: ${{ startsWith(matrix.os, 'rhel-') }}
uses: ./.github/actions/podman-entitlement
with:
org: ${{ secrets.REDHAT_ORG }}
activationkey: ${{ secrets.REDHAT_ACTIVATIONKEY }}
- name: Run partial tests
run: docker=${{ matrix.docker }} tests/run-partial-tests.sh Dockerfile.${{ matrix.os }}