Repository navigation
91 lines (76 loc) · 2.49 KB
/
Copy pathtest.yml
File metadata and controls
91 lines (76 loc) · 2.49 KB
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
name: Test
on:
workflow_call:
inputs:
host-os:
required: false
type: string
default: ubuntu-22.04
ack:
required: true
type: string
arch:
required: true
type: string
version:
required: true
type: string
artifact-dir:
required: true
type: string
kernel-image-name:
required: true
type: string
suffix:
required: true
type: string
jobs:
test:
name: Test (ack=${{ inputs.ack }}, ${{ inputs.version }}, ${{ inputs.arch }})
runs-on: ubuntu-22.04
# Put ACK and ARCH in the environment so it's picked up by the `make` commands
env:
ACK: ${{ inputs.ack }}
ARCH: ${{ inputs.arch }}
steps:
- uses: actions/checkout@v4
- name: Download kernel artifacts
uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact-dir }}
path: ${{ inputs.artifact-dir }}
- name: Download rootfs artifacts
uses: actions/download-artifact@v4
with:
name: rootfs-${{ inputs.arch }}
path: rootfs
- run: ls -lR
- name: Install x86_64 dependencies
if: ${{ inputs.arch == 'x86_64' }}
run: sudo apt update && sudo apt install -y qemu-system-x86
- name: Install arm64 dependencies
if: ${{ inputs.arch == 'arm64' }}
run: sudo apt update && sudo apt install -y qemu-system-arm
- name: Setup shared/init.sh
run: |
mkdir shared
echo poweroff > shared/init.sh
chmod +x shared/init.sh
- name: Run kernel
run: |
export QEMU_KERNEL_IMAGE=${{ inputs.artifact-dir }}/${{ inputs.kernel-image-name }}-${{ inputs.suffix }}
ALPINE_ROOTFS=alpine-${{ inputs.arch }}.img
UBUNTU_ROOTFS=ubuntu-jammy-${{ inputs.arch }}.img
UBUNTU_CPIO=ubuntu-jammy-${{ inputs.arch }}.cpio.gz
cp ./rootfs/${ALPINE_ROOTFS} ./${ALPINE_ROOTFS}
cp ./rootfs/${UBUNTU_CPIO} ./${UBUNTU_CPIO}
# Run with default alpine rootfs
make run
# Run with ubuntu rootfs
ROOTFS=./rootfs/${UBUNTU_ROOTFS} make run
# Run with default alpine cpio
INITRD=1 make run
# Run with ubuntu cpio in non-standard location
INITRD=./${UBUNTU_CPIO} make run
# Run with alpine rootfs in non-standard location, with additional options
CPU=2 MEM=2048M QEMU_EXTRA_ARGS="" QEMU_EXTRA_KERNEL_CMDLINE="nokaslr" ROOTFS=./${ALPINE_ROOTFS} make run