chore(ci): Use matrix for nvidia type

This commit is contained in:
Kyle Gospodnetich 2024-09-04 19:13:53 -07:00
parent 8faadd9400
commit e523d25e30

View File

@ -58,9 +58,10 @@ jobs:
fail-fast: false
matrix:
base_image_flavor: [main]
base_name: [bazzite, bazzite-deck, bazzite-nvidia, bazzite-nvidia-open]
base_name: [bazzite, bazzite-deck, bazzite-nvidia]
base_image_name: [kinoite, silverblue]
target_image_flavor: [main, asus]
target_nvidia_flavor: [nvidia, nvidia-open]
fedora_version: [40]
include:
- fedora_version: 40
@ -68,10 +69,15 @@ jobs:
is_stable_version: true
kernel_flavor: fsync-ba # must match a kernel_flavor from akmods repo
kernel_version: 6.9.12-205.fsync.fc40.x86_64 # must match a cached version of the above flavor
exclude:
- base_name: bazzite
target_nvidia_flavor: nvidia
- base_name: bazzite-deck
target_nvidia_flavor: nvidia
steps:
- name: Define env.IMAGE_FLAVOR
run: |
if [[ "${{ matrix.base_name }}" == "bazzite-nvidia" || "${{ matrix.base_name }}" == "bazzite-nvidia-open" ]]; then
if [[ "${{ matrix.base_name }}" == "bazzite-nvidia" ]]; then
if [[ "${{ matrix.target_image_flavor }}" == "main" ]]; then
echo "IMAGE_FLAVOR=nvidia" >> $GITHUB_ENV
else
@ -81,14 +87,6 @@ jobs:
echo "IMAGE_FLAVOR=${{ matrix.target_image_flavor }}" >> $GITHUB_ENV
fi
- name: Define env.NVIDIA_FLAVOR
run: |
if [[ "${{ matrix.base_name }}" == "bazzite-nvidia-open" ]]; then
echo "NVIDIA_FLAVOR=nvidia-open" >> $GITHUB_ENV
else
echo "NVIDIA_FLAVOR=nvidia" >> $GITHUB_ENV
fi
- name: Define env.IMAGE_NAME
run: |
DESKTOP=""
@ -102,8 +100,8 @@ jobs:
else
echo "IMAGE_NAME=${{ format('{0}{1}', 'bazzite-deck', '${DESKTOP}') }}" >> $GITHUB_ENV
fi
elif [[ "${{ matrix.base_name }}" == "bazzite-nvidia-open" ]]; then
echo "IMAGE_NAME=${{ format('{0}{1}', 'bazzite-nvidia-open', '${DESKTOP}') }}" >> $GITHUB_ENV
elif [[ "${{ matrix.base_name }}" == "bazzite-nvidia" && "${{ matrix.target_nvidia_flavor }}" == "nvidia-open" ]]; then
echo "IMAGE_NAME=${{ format('{0}{1}-nvidia-open', 'bazzite', '${DESKTOP}', env.IMAGE_FLAVOR) }}" >> $GITHUB_ENV
else
if [[ "${{ env.IMAGE_FLAVOR }}" == "main" ]]; then
echo "IMAGE_NAME=${{ format('{0}{1}', 'bazzite', '${DESKTOP}') }}" >> $GITHUB_ENV
@ -133,7 +131,7 @@ jobs:
- name: Verify akmods-nvidia image
uses: EyeCantCU/cosign-action/verify@v0.3.0
with:
containers: akmods-${{ env.NVIDIA_FLAVOR }}:${{ matrix.kernel_flavor}}-${{ matrix.fedora_version }}-${{ matrix.kernel_version }}
containers: akmods-${{ matrix.target_nvidia_flavor }}:${{ matrix.kernel_flavor}}-${{ matrix.fedora_version }}-${{ matrix.kernel_version }}
pubkey: https://raw.githubusercontent.com/ublue-os/akmods/main/cosign.pub
registry: ${{ env.IMAGE_REGISTRY }}
@ -167,7 +165,7 @@ jobs:
# we can retry on that unfortunately common failure case
sudo podman pull ${{ env.IMAGE_REGISTRY }}/${{ matrix.base_image_name }}-${{ matrix.base_image_flavor }}:${{ matrix.fedora_version }}
sudo podman pull ${{ env.IMAGE_REGISTRY }}/akmods:${{ matrix.kernel_flavor}}-${{ matrix.fedora_version }}-${{ matrix.kernel_version }}
sudo podman pull ${{ env.IMAGE_REGISTRY }}/akmods-${{ env.NVIDIA_FLAVOR }}:${{ matrix.kernel_flavor}}-${{ matrix.fedora_version }}-${{ matrix.kernel_version }}
sudo podman pull ${{ env.IMAGE_REGISTRY }}/akmods-${{ matrix.target_nvidia_flavor }}:${{ matrix.kernel_flavor}}-${{ matrix.fedora_version }}-${{ matrix.kernel_version }}
# Add rechunk as well to remove this source of failure
sudo podman pull ghcr.io/hhd-dev/rechunk:v0.8.3
@ -227,7 +225,7 @@ jobs:
--target ${{ matrix.base_name }} \
--build-arg IMAGE_NAME=${{ env.IMAGE_NAME }} \
--build-arg IMAGE_FLAVOR=${{ env.IMAGE_FLAVOR }} \
--build-arg NVIDIA_FLAVOR=${{ env.NVIDIA_FLAVOR }} \
--build-arg NVIDIA_FLAVOR=${{ matrix.target_nvidia_flavor }} \
--build-arg IMAGE_VENDOR=${{ github.repository_owner }} \
--build-arg BASE_IMAGE_NAME=${{ matrix.base_image_name }} \
--build-arg BASE_IMAGE_FLAVOR=${{ matrix.base_image_flavor }} \
@ -245,7 +243,7 @@ jobs:
run: |
sudo podman image rm ${{ env.IMAGE_REGISTRY }}/${{ matrix.base_image_name }}-${{ matrix.base_image_flavor }}:${{ matrix.fedora_version }}
sudo podman image rm ${{ env.IMAGE_REGISTRY }}/akmods:${{ matrix.kernel_flavor}}-${{ matrix.fedora_version }}-${{ matrix.kernel_version }}
sudo podman image rm ${{ env.IMAGE_REGISTRY }}/akmods-${{ env.NVIDIA_FLAVOR }}:${{ matrix.kernel_flavor}}-${{ matrix.fedora_version }}-${{ matrix.kernel_version }}
sudo podman image rm ${{ env.IMAGE_REGISTRY }}/akmods-${{ matrix.target_nvidia_flavor }}:${{ matrix.kernel_flavor}}-${{ matrix.fedora_version }}-${{ matrix.kernel_version }}
# Generate the previous image reference used by the Rechunker
- name: Generate previous reference