Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github-actions: add test to build dropin targets #620

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/drop-in-target-build-only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Execute make qm_dropin targets

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
run_qm_dropin_targets:
runs-on: ubuntu-latest

container:
image: fedora:latest # Use Fedora as the container for this job
#options: --privileged # Enable privileged mode for nested containers if necessary (optional)

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install required tools and Podman
run: |
dnf group install -y "Development Tools"
dnf install -y make bzip2 grep sed podman rpm-build selinux-policy-devel selinux-policy container-selinux golang-github-cpuguy83-md2man

- name: Get qm_dropin targets
id: get_targets
run: |
# Extract all qm_dropin targets from Makefile
targets=$(grep -oE '^qm_dropin_[a-zA-Z0-9_-]+:' Makefile | sed 's/://g')
if [ -z "$targets" ]; then
echo "No qm_dropin targets found."
exit 0
fi
# Replace newlines with spaces to create a single-line environment variable
targets=$(echo "$targets" | tr '\n' ' ')
echo "Found qm_dropin targets: $targets"
echo "targets=$targets" >> $GITHUB_ENV

- name: Run qm_dropin targets
run: |
# Execute all qm_dropin targets
for target in ${{ env.targets }}; do
echo "Running target: $target"
make $target || exit 1
done

- name: Notify success
if: success()
run: echo "All qm_dropin targets executed successfully."

- name: Notify failure
if: failure()
run: echo "One or more qm_dropin targets failed." && exit 1
Loading