-
-
Notifications
You must be signed in to change notification settings - Fork 101
132 lines (118 loc) · 4.48 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: CI
on:
- pull_request
- push
jobs:
test-ubuntu:
name: Test on Ubuntu
runs-on: ubuntu-latest
steps:
- name: Install qemu-utils
run: |
sudo apt-get update
sudo apt-get install qemu-utils
- uses: actions/checkout@v3
- name: Build image for x86_64 with BIOS mode and without GPT
run: |
sudo ./alpine-make-vm-image \
--image-format qcow2 \
--image-size 2G \
--repositories-file example/repositories \
--packages "$(cat example/packages)" \
--fs-skel-dir example/rootfs \
--fs-skel-chown root:root \
--script-chroot \
alpine-bios-$(date +%Y-%m-%d).qcow2 -- ./example/configure.sh
- name: Build image for x86_64 with BIOS mode and GPT
run: |
sudo ./alpine-make-vm-image \
--image-format raw \
--image-size 2G \
--partition \
--repositories-file example/repositories \
--packages "$(cat example/packages)" \
--fs-skel-dir example/rootfs \
--fs-skel-chown root:root \
--script-chroot \
alpine-bios-part-$(date +%Y-%m-%d).raw -- ./example/configure.sh
- name: Build image for x86_64 with UEFI mode
run: |
sudo ./alpine-make-vm-image \
--image-format qcow2 \
--image-size 2G \
--boot-mode UEFI \
--repositories-file example/repositories \
--packages "$(cat example/packages)" \
--fs-skel-dir example/rootfs \
--fs-skel-chown root:root \
--script-chroot \
alpine-uefi-$(date +%Y-%m-%d).qcow2 -- ./example/configure.sh
- name: Install qemu-aarch64 and register in binfmt
uses: jirutka/setup-alpine@v1
with:
arch: aarch64
- name: Build image for aarch64
run: |
sudo ./alpine-make-vm-image \
--arch aarch64 \
--image-format qcow2 \
--image-size 2G \
--repositories-file example/repositories \
--packages "$(cat example/packages) linux-virt@edge" \
--fs-skel-dir example/rootfs \
--fs-skel-chown root:root \
--script-chroot \
alpine-aarch64-$(date +%Y-%m-%d).qcow2 -- ./example/configure.sh
test-alpine:
name: Test on Alpine
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# We must run this outside the chroot.
- run: sudo modprobe nbd max_part=16
- name: Set up latest Alpine Linux
uses: jirutka/setup-alpine@v1
- name: Build image for x86_64 with BIOS mode and without GPT
run: |
./alpine-make-vm-image \
--image-format qcow2 \
--image-size 2G \
--repositories-file example/repositories \
--packages "$(cat example/packages)" \
--fs-skel-dir example/rootfs \
--fs-skel-chown root:root \
--script-chroot \
alpine-bios-$(date +%Y-%m-%d).qcow2 -- ./example/configure.sh
shell: alpine.sh --root {0}
- name: Build image for x86_64 with UEFI mode
run: |
./alpine-make-vm-image \
--image-format qcow2 \
--image-size 2G \
--boot-mode UEFI \
--repositories-file example/repositories \
--packages "$(cat example/packages)" \
--fs-skel-dir example/rootfs \
--fs-skel-chown root:root \
--script-chroot \
alpine-uefi-$(date +%Y-%m-%d).qcow2 -- ./example/configure.sh
shell: alpine.sh --root {0}
- name: Install qemu-aarch64 and register in binfmt
uses: jirutka/setup-alpine@v1
with:
arch: aarch64
shell-name: alpine-aarch64.sh
# Note: We cannot run alpine-make-vm-image inside emulated chroot due to nbd.
- name: Build image for aarch64
run: |
./alpine-make-vm-image \
--arch aarch64 \
--branch edge \
--image-format qcow2 \
--image-size 2G \
--packages "$(cat example/packages)" \
--fs-skel-dir example/rootfs \
--fs-skel-chown root:root \
--script-chroot \
alpine-aarch64-$(date +%Y-%m-%d).qcow2 -- ./example/configure.sh
shell: alpine.sh --root {0}