Skip to content

bfb-install: Handle PF1 bind/unbind in NIC mode #8

bfb-install: Handle PF1 bind/unbind in NIC mode

bfb-install: Handle PF1 bind/unbind in NIC mode #8

Workflow file for this run

---
#
# Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
name: CI/CD pipeline for rshim - deb and rpm for amd64 and arm64
on:
push:
branches:
- '**'
tags:
- '*'
permissions:
contents: write
jobs:
build-and-test:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-tags: true
- name: Install dependencies (for .deb)
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential debhelper devscripts fakeroot git \
libpci-dev libusb-1.0-0-dev libfuse-dev pkg-config
- name: Prepare release body
id: changelog
run: |
body=$(./scripts/get-changelog debian/changelog)
echo "body<<EOF" >> $GITHUB_OUTPUT
echo "${body}" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create source tarball
run: |
[ -d dist ] || mkdir -p dist
version="$(./scripts/get-ver)"
tarball="rshim-src-${version}.tar.gz"
git archive --format=tar.gz -o "$tarball" HEAD
mv -v "$tarball" dist/
ls -lh dist
- name: Build & Test x86_64 .deb package
run: |
version="$(./scripts/get-ver)"
sed -i "1s/(\(.*\))/($version)/" debian/changelog
DEB_BUILD_OPTIONS="nocheck nostrip" dpkg-buildpackage \
-us -uc -a amd64
mkdir -p dist
mv -v ../*.deb dist/
ls -lh dist
sudo dpkg -i dist/*.deb || sudo apt-get -f install -y
echo "Running rshim --version:"
rshim --version
- name: Capture UID/GID for Docker
id: uidgid
run: |
echo "HOST_UID=$(id -u)" >> $GITHUB_ENV
echo "HOST_GID=$(id -g)" >> $GITHUB_ENV
- name: Build & Test ARM64 .deb package in Docker
run: |
docker run --rm --privileged multiarch/qemu-user-static \
--reset -p yes
docker run --rm --platform linux/arm64 \
-e HOST_UID="${{ env.HOST_UID }}" \
-e HOST_GID="${{ env.HOST_GID }}" \
-v "${{ github.workspace }}:/workspace" \
-w /workspace \
arm64v8/ubuntu:22.04 \
/bin/bash -c "
apt-get update && \
apt-get install -y build-essential debhelper devscripts \
fakeroot gcc git libpci-dev libusb-1.0-0-dev libfuse-dev \
pkg-config && \
git config --global --add safe.directory /workspace && \
version=\$(/workspace/scripts/get-ver) && \
sed -i \"1s/(\(.*\))/(\$version)/\" \
/workspace/debian/changelog && \
mkdir -p /workspace/build && \
DEB_BUILD_OPTIONS='nocheck nostrip' dpkg-buildpackage \
-us -uc -a arm64 && \
mv -v ../*.deb /workspace/build/ && \
apt-get install -y libpci3 libusb-1.0-0 fuse || true && \
dpkg -i /workspace/build/*.deb || apt-get -f install -y && \
echo 'Running rshim --version:' && \
rshim --version && \
chown -R \$HOST_UID:\$HOST_GID /workspace
"
mkdir -p dist
mv -v build/*.deb dist/
ls -lh dist
- name: Build & Test x86_64 RPM using Rocky Linux
run: |
docker run --rm \
-e HOST_UID="${{ env.HOST_UID }}" \
-e HOST_GID="${{ env.HOST_GID }}" \
-v "${{ github.workspace }}:/workspace" \
-w /workspace \
quay.io/rockylinux/rockylinux:8 \
/bin/bash -c "
yum -y install gcc make rpm-build git autoconf automake \
libtool pkgconfig pciutils-devel libusb1-devel fuse-devel && \
git config --global --add safe.directory /workspace && \
ARCH=x86_64 ./scripts/build-rpm && \
yum localinstall -y /workspace/rpmbuild/RPMS/x86_64/*.rpm && \
echo 'Running rshim --version:' && \
rshim --version && \
chown -R \$HOST_UID:\$HOST_GID /workspace
"
mkdir -p dist
mv -v $(find rpmbuild/RPMS -name '*.rpm') dist/
ls -lh dist
- name: Build & Test arm64 RPM using Rocky Linux
run: |
docker run --rm --privileged multiarch/qemu-user-static \
--reset -p yes
docker run --rm --platform linux/arm64 \
-e HOST_UID="${{ env.HOST_UID }}" \
-e HOST_GID="${{ env.HOST_GID }}" \
-v "${{ github.workspace }}:/workspace" \
-w /workspace \
quay.io/rockylinux/rockylinux:8 \
/bin/bash -c "
yum -y install gcc make rpm-build git autoconf automake \
libtool pkgconfig pciutils-devel libusb1-devel fuse-devel && \
git config --global --add safe.directory /workspace && \
ARCH=aarch64 ./scripts/build-rpm && \
yum localinstall -y /workspace/rpmbuild/RPMS/aarch64/*.rpm && \
echo 'Running rshim --version:' && \
rshim --version && \
chown -R \$HOST_UID:\$HOST_GID /workspace
"
mkdir -p dist
mv -v $(find rpmbuild/RPMS -name '*.rpm') dist/
ls -lh dist
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: rshim-packages
path: dist/*
- name: Create GitHub Release
if: startsWith(github.ref_name, 'rshim-')
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
body: ${{ steps.changelog.outputs.body }}
draft: false
prerelease: false
files: dist/*