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

fix(specs): add libcmocka-devel to BuildRequires #55

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
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
75 changes: 75 additions & 0 deletions .github/workflows/rpms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: RPM Packaging CI
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
container:
- fedora:41
- ghcr.io/almalinux/9-base:latest
- ghcr.io/almalinux/8-base:latest
- mcr.microsoft.com/cbl-mariner/base/core:2.0
- mcr.microsoft.com/azurelinux/base/core:3.0

container:
image: ${{ matrix.container }}
options: --user root

defaults:
run:
shell: bash

steps:
- name: Identify OS
run: cat /etc/os-release
- name: Install dependencies
run: |
set -x
id
case "${{ matrix.container }}" in
*almalinux/8*)
dnf install -y 'dnf-command(config-manager)'
dnf config-manager --set-enabled powertools
;;
*almalinux/9*)
dnf install -y 'dnf-command(config-manager)'
dnf config-manager --set-enabled crb
;;
*azurelinux*|*cbl-mariner*)
export HOME=/root # tdnf requires HOME to be set to /root
tdnf install -y awk ca-certificates dnf --verbose
;;
esac
dnf install -y git sudo
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
fetch-depth: 0
fetch-tags: true
- name: Get tags from upstream, if needed
if: github.repository != 'Azure/azure-vm-utils'
run: |
git remote add upstream https://github.com/Azure/azure-vm-utils.git
git fetch upstream --tags
- name: Build RPMs
run: |
set -x
git config --global --add safe.directory "$(pwd)"
./scripts/build-rpm.sh
- name: Install rpms
run: |
rpm -Uvh -i out/*.rpm
- name: Verify installation
run: |
set -x
rpm -qa azure-vm-utils
test -f /usr/share/man/man8/azure-nvme-id.8.gz
test -f /usr/sbin/azure-nvme-id || test -f /usr/bin/azure-nvme-id
test -f /usr/lib/dracut/modules.d/97azure-disk/module-setup.sh
test -f /usr/lib/udev/rules.d/80-azure-disk.rules
azure-nvme-id --version
1 change: 1 addition & 0 deletions packaging/almalinux
4 changes: 3 additions & 1 deletion packaging/fedora/azure-vm-utils.spec
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Source0: %{name}_dev.tgz

BuildRequires: cmake
BuildRequires: gcc
BuildRequires: libcmocka-devel

%description
A collection of utilities and udev rules to make the most of the Linux
Expand All @@ -34,4 +35,5 @@ experience on Azure.
%{_mandir}/man8/azure-nvme-id.8.gz

%changelog
%autochangelog
* Wed Feb 05 2025 Test <[email protected]> - %{__git_version}-%{__git_release}
- Test test test
2 changes: 2 additions & 0 deletions packaging/mariner/azure-vm-utils.spec
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ BuildRequires: cmake
BuildRequires: gcc
BuildRequires: glibc-devel
BuildRequires: kernel-headers
BuildRequires: libcmocka-devel
BuildRequires: make

%description
A collection of utilities and udev rules to make the most of the Linux
Expand Down
7 changes: 6 additions & 1 deletion scripts/build-rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ cd "${project_dir}/packaging/${distro}"

# Install dependencies.
build_requirements=$(grep ^BuildRequires azure-vm-utils.spec | awk '{{print $2}}' | tr '\n' ' ')
sudo dnf install -y ${build_requirements}
install_build_requirements_cmd="dnf install -y ${build_requirements} rpm-build dracut"
if [[ $UID -ne 0 ]]; then
sudo $install_build_requirements_cmd
else
$install_build_requirements_cmd
fi

# Build RPM.
rpmbuild -ba --define "__git_version ${version}" --define "__git_release ${release}" --define "_topdir ${build_dir}" azure-vm-utils.spec
Expand Down