| 1 |
name: RPM Packaging CI |
| 2 |
on: [push, pull_request] |
| 3 |
|
| 4 |
jobs: |
| 5 |
build: |
| 6 |
runs-on: ubuntu-latest |
| 7 |
|
| 8 |
strategy: |
| 9 |
fail-fast: false |
| 10 |
matrix: |
| 11 |
container: |
| 12 |
- fedora:41 |
| 13 |
- fedora:42 |
| 14 |
- fedora:rawhide |
| 15 |
- ghcr.io/almalinux/9-base:latest |
| 16 |
- ghcr.io/almalinux/8-base:latest |
| 17 |
- mcr.microsoft.com/cbl-mariner/base/core:2.0 |
| 18 |
- mcr.microsoft.com/azurelinux/base/core:3.0 |
| 19 |
|
| 20 |
container: |
| 21 |
image: ${{ matrix.container }} |
| 22 |
options: --user root |
| 23 |
|
| 24 |
defaults: |
| 25 |
run: |
| 26 |
shell: bash |
| 27 |
|
| 28 |
steps: |
| 29 |
- name: Identify OS |
| 30 |
run: cat /etc/os-release |
| 31 |
- name: Install dependencies |
| 32 |
run: | |
| 33 |
set -x |
| 34 |
id |
| 35 |
case "${{ matrix.container }}" in |
| 36 |
*almalinux/8*) |
| 37 |
dnf install -y 'dnf-command(config-manager)' epel-release |
| 38 |
dnf config-manager --set-enabled powertools |
| 39 |
dnf install -y python39 |
| 40 |
alternatives --set python3 /usr/bin/python3.9 |
| 41 |
/usr/bin/env python3 --version |
| 42 |
;; |
| 43 |
*almalinux/9*) |
| 44 |
dnf install -y 'dnf-command(config-manager)' |
| 45 |
dnf config-manager --set-enabled crb |
| 46 |
;; |
| 47 |
*azurelinux*|*cbl-mariner*) |
| 48 |
export HOME=/root # tdnf requires HOME to be set to /root |
| 49 |
tdnf install -y awk ca-certificates dnf --verbose |
| 50 |
;; |
| 51 |
*fedora*) |
| 52 |
dnf install -y awk |
| 53 |
;; |
| 54 |
esac |
| 55 |
dnf install -y git sudo |
| 56 |
- name: Checkout code |
| 57 |
uses: actions/checkout@v4 |
| 58 |
with: |
| 59 |
ref: ${{ github.sha }} |
| 60 |
fetch-depth: 0 |
| 61 |
fetch-tags: true |
| 62 |
- name: Get tags from upstream, if needed |
| 63 |
if: github.repository != 'Azure/azure-vm-utils' |
| 64 |
run: | |
| 65 |
git remote add upstream https://github.com/Azure/azure-vm-utils.git |
| 66 |
git fetch upstream --tags |
| 67 |
- name: Build RPMs |
| 68 |
run: | |
| 69 |
set -x |
| 70 |
git config --global --add safe.directory "$(pwd)" |
| 71 |
./scripts/build-rpm.sh |
| 72 |
- name: Install rpms |
| 73 |
run: | |
| 74 |
rpm -Uvh -i out/*.rpm |
| 75 |
- name: Verify installation |
| 76 |
run: | |
| 77 |
set -x |
| 78 |
rpm -qa azure-vm-utils |
| 79 |
test -f /usr/lib/dracut/modules.d/97azure-disk/module-setup.sh |
| 80 |
test -f /usr/lib/dracut/modules.d/97azure-unmanaged-sriov/module-setup.sh |
| 81 |
test -f /usr/lib/systemd/network/01-azure-unmanaged-sriov.network |
| 82 |
test -f /usr/lib/udev/rules.d/10-azure-unmanaged-sriov.rules |
| 83 |
test -f /usr/lib/udev/rules.d/80-azure-disk.rules |
| 84 |
test -x /usr/sbin/azure-nvme-id || test -x /usr/bin/azure-nvme-id |
| 85 |
test -x /usr/sbin/azure-vm-utils-selftest || test -x /usr/bin/azure-vm-utils-selftest |
| 86 |
test -f /usr/share/man/man8/azure-nvme-id.8.gz |
| 87 |
test -f /usr/share/man/man8/azure-vm-utils-selftest.8.gz |
| 88 |
azure-nvme-id --version |
| 89 |
azure-vm-utils-selftest --skip-imds-validation --skip-symlink-validation |