github/workflows: Update to ubuntu-24.04 & podman #166
Workflow file for this run
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
name: CI | |
permissions: | |
actions: read | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: {} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
c9s-bootc-e2e: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Update everything | |
run: | | |
set -xeuo pipefail | |
sudo apt purge snapd | |
sudo apt update && sudo apt upgrade | |
# We use docker to build because it updates to the latest, whereas right now ubuntu-latest | |
# has podman and buildah from ~2021 (insane!) | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- uses: actions/checkout@v3 | |
- name: Cache Dependencies | |
uses: Swatinem/rust-cache@v2 | |
with: | |
key: "build-c9s" | |
- name: Build and export to Docker | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ci/Containerfile.c9s | |
load: true | |
tags: localhost/bootupd:latest | |
- name: Copy to podman | |
run: sudo skopeo copy docker-daemon:localhost/bootupd:latest containers-storage:localhost/bootupd:latest | |
- name: bootc install to disk | |
run: | | |
set -xeuo pipefail | |
sudo truncate -s 10G myimage.raw | |
sudo podman run --rm -ti --privileged -v .:/target --pid=host --security-opt label=disable \ | |
-v /var/lib/containers:/var/lib/containers \ | |
-v /dev:/dev \ | |
localhost/bootupd:latest bootc install to-disk --skip-fetch-check \ | |
--disable-selinux --generic-image --via-loopback /target/myimage.raw | |
# Verify we installed grub.cfg and shim on the disk | |
sudo losetup -P -f myimage.raw | |
device=$(losetup --list --noheadings --output NAME,BACK-FILE | grep myimage.raw | awk '{print $1}') | |
sudo mount "${device}p2" /mnt/ | |
sudo ls /mnt/EFI/centos/{grub.cfg,shimx64.efi} | |
sudo umount /mnt | |
sudo losetup -D "${device}" | |
sudo rm -f myimage.raw | |
- name: bootc install to filesystem | |
run: | | |
set -xeuo pipefail | |
sudo podman run --rm -ti --privileged -v /:/target --pid=host --security-opt label=disable \ | |
-v /var/lib/containers:/var/lib/containers \ | |
localhost/bootupd:latest bootc install to-filesystem --skip-fetch-check \ | |
--disable-selinux --replace=alongside /target | |
# Verify we injected static configs | |
jq -re '.["static-configs"].version' /boot/bootupd-state.json |