zfs-qemu-packages #65
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow is used to build and test RPM packages. It is intended to be | |
# used to build RPMs for ZFS releases, and then test install them from a | |
# repository. | |
name: zfs-qemu-packages | |
on: | |
workflow_dispatch: | |
inputs: | |
test_repo: | |
type: boolean | |
required: false | |
default: false | |
description: "Do a repo test install instead of building RPMs" | |
repo_url: | |
type: string | |
required: false | |
default: "" | |
description: "Test repo location (blank - use default)" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
zfs-qemu-packages-jobs: | |
name: qemu-VMs | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ['almalinux8', 'almalinux9', 'fedora40', 'fedora41'] | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Setup QEMU | |
timeout-minutes: 10 | |
run: .github/workflows/scripts/qemu-1-setup.sh | |
- name: Start build machine | |
timeout-minutes: 10 | |
run: .github/workflows/scripts/qemu-2-start.sh ${{ matrix.os }} | |
- name: Install dependencies | |
timeout-minutes: 20 | |
run: | | |
.github/workflows/scripts/qemu-3-deps.sh ${{ matrix.os }} | |
- name: Build modules / Test repo | |
timeout-minutes: 30 | |
run: | | |
set -e | |
if [ "${{ github.event.inputs.test_repo }}" == "true" ] ; then | |
# Bring VM back up and copy over zfs source | |
.github/workflows/scripts/qemu-prepare-for-build.sh | |
mkdir -p /tmp/repo | |
ssh zfs@vm0 '$HOME/zfs/.github/workflows/scripts/qemu-test-repo-vm.sh' ${{ github.event.inputs.repo_url }} | |
else | |
.github/workflows/scripts/qemu-4-build.sh --repo --release --dkms ${{ matrix.os }} | |
fi | |
- name: Prepare artifacts | |
if: always() | |
timeout-minutes: 10 | |
run: | | |
rsync -a zfs@vm0:/tmp/repo /tmp || true | |
.github/workflows/scripts/replace-dupes-with-symlinks.sh /tmp/repo | |
tar -cf ${{ matrix.os }}-repo.tar -C /tmp repo | |
- uses: actions/upload-artifact@v4 | |
id: artifact-upload | |
if: always() | |
with: | |
name: ${{ matrix.os }}-repo | |
path: ${{ matrix.os }}-repo.tar | |
compression-level: 0 | |
retention-days: 2 | |
if-no-files-found: ignore | |
combine_repos: | |
if: always() | |
needs: [zfs-qemu-packages-jobs] | |
name: "Summary" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v4 | |
id: artifact-download | |
if: always() | |
- name: Test Summary | |
if: always() | |
run: | | |
for i in $(find . -type f -iname "*.tar") ; do | |
tar -xf $i -C /tmp | |
done | |
tar -cf all-repo.tar -C /tmp repo | |
# If we're installing from a repo, print out the summary of the versions | |
# that got installed | |
if [ "${{ github.event.inputs.test_repo }}" == "true" ] ; then | |
cd /tmp/repo | |
for i in $(ls *.txt) ; do | |
echo "--- $i ---" | |
cat $i | |
echo "" | |
done | |
# Markdown version for summary | |
for i in $(ls *.txt) ; do | |
echo "## $i" >> $GITHUB_STEP_SUMMARY | |
echo "|repo|RPM|" >> $GITHUB_STEP_SUMMARY | |
echo "|:---|:---|" >> $GITHUB_STEP_SUMMARY | |
awk '{print "|"$1"|"$2"|"}' $i >> $GITHUB_STEP_SUMMARY | |
done | |
fi | |
- uses: actions/upload-artifact@v4 | |
id: artifact-upload2 | |
if: always() | |
with: | |
name: all-repo | |
path: all-repo.tar | |
compression-level: 0 | |
retention-days: 5 | |
if-no-files-found: ignore |