-
Notifications
You must be signed in to change notification settings - Fork 28
92 lines (80 loc) · 3.03 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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:
strategy:
matrix:
runner:
- ubuntu-24.04
- ubuntu-24.04-arm
runs-on: [ "${{ matrix.runner }}" ]
steps:
- uses: actions/checkout@v4
- name: Install podman
if: ( matrix.runner == 'ubuntu-24.04-arm' )
run: |
sudo apt update -y
sudo apt install -y podman
- name: build
run: sudo podman build -t localhost/bootupd:latest -f ci/Containerfile.c9s .
- name: bootupctl status in container
run: |
set -xeuo pipefail
arch="$(uname --machine)"
if [[ "${arch}" == "x86_64" ]]; then
components_text='Available components: BIOS EFI'
components_json='{"components":["BIOS","EFI"]}'
else
# Assume aarch64 for now
components_text='Available components: EFI'
components_json='{"components":["EFI"]}'
fi
output=$(sudo podman run --rm -ti localhost/bootupd:latest bootupctl status | tr -d '\r')
[ "${components_text}" == "${output}" ]
output=$(sudo podman run --rm -ti localhost/bootupd:latest bootupctl status --json)
[ "${components_json}" == "${output}" ]
- 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/
arch="$(uname --machine)"
if [[ "${arch}" == "x86_64" ]]; then
shim="shimx64.efi"
else
# Assume aarch64 for now
shim="shimaa64.efi"
fi
sudo ls /mnt/EFI/centos/{grub.cfg,${shim}}
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 /dev:/dev -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