Skip to content

Commit a194cd2

Browse files
committed
github-actions: add test to build dropin targets
Just test if make dropin targets works Signed-off-by: Douglas Landgraf <[email protected]>
1 parent 2cb6d3e commit a194cd2

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

Diff for: .github/workflows/drop-in-target-build-only.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Execute make qm_dropin targets
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
run_qm_dropin_targets:
13+
runs-on: ubuntu-latest
14+
15+
container:
16+
image: fedora:latest # Use Fedora as the container for this job
17+
#options: --privileged # Enable privileged mode for nested containers if necessary (optional)
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v2
22+
23+
- name: Install required tools and Podman
24+
run: |
25+
dnf group install -y "Development Tools"
26+
dnf install -y make bzip2 grep sed podman rpm-build selinux-policy-devel selinux-policy container-selinux golang-github-cpuguy83-md2man
27+
28+
- name: Get qm_dropin targets
29+
id: get_targets
30+
run: |
31+
# Extract all qm_dropin targets from Makefile
32+
targets=$(grep -oE '^qm_dropin_[a-zA-Z0-9_-]+:' Makefile | sed 's/://g')
33+
if [ -z "$targets" ]; then
34+
echo "No qm_dropin targets found."
35+
exit 0
36+
fi
37+
# Replace newlines with spaces to create a single-line environment variable
38+
targets=$(echo "$targets" | tr '\n' ' ')
39+
echo "Found qm_dropin targets: $targets"
40+
echo "targets=$targets" >> $GITHUB_ENV
41+
42+
- name: Run qm_dropin targets
43+
run: |
44+
# Execute all qm_dropin targets
45+
for target in ${{ env.targets }}; do
46+
echo "Running target: $target"
47+
make $target || exit 1
48+
done
49+
50+
- name: Notify success
51+
if: success()
52+
run: echo "All qm_dropin targets executed successfully."
53+
54+
- name: Notify failure
55+
if: failure()
56+
run: echo "One or more qm_dropin targets failed." && exit 1

0 commit comments

Comments
 (0)