-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
97 lines (84 loc) · 3.38 KB
/
Copy pathTaskfile.yml
File metadata and controls
97 lines (84 loc) · 3.38 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
92
93
94
95
96
97
# Convenience targets. The Go workflow stays `go build/test/vet`; these wrap the
# Tier 2 loopback integration harness, which needs root (losetup/lvm/archinstall).
#
# Tooling is managed by mise (see mise.toml): `mise install` provisions Go + task,
# then `task <name>` or `mise run <name>` drives the workflow.
version: '3'
vars:
# e2e disk-layout knobs, overridable on the CLI:
# task e2e-disks-light LAYOUT=single-disk-lvm FS=ext4
LAYOUT: '{{.LAYOUT | default "multi-disk-lvm"}}'
FS: '{{.FS | default "xfs"}}'
# Arch live ISO for the QEMU smoke test. Cached under the gitignored .iso/ dir
# and pinned to a dated archive build so the download is reproducible. Bump
# ISO_VERSION (CLI-overridable) in lockstep with the version in test/vm.sh.
ISO_VERSION: '{{.ISO_VERSION | default "2026.07.01"}}'
ISO_FILE: 'archlinux-{{.ISO_VERSION}}-x86_64.iso'
ISO_PATH: '.iso/{{.ISO_FILE}}'
tasks:
build:
desc: Build the archwright binary.
cmds:
- go build -o archwright .
test:
desc: Run unit tests (validation table + per-stage command plans).
cmds:
- go test ./...
vet:
desc: Run go vet.
cmds:
- go vet ./...
e2e-disks-light:
desc: >-
Validate archwright's rendered archinstall JSON against a real archinstall
(--dry-run) on loop devices. No install, no network.
cmds:
- sudo bash test/e2e/disks.sh --mode light --layout {{.LAYOUT}} --fs {{.FS}}
e2e-disks-full:
desc: >-
Real partition/format/pacstrap onto loop devices, then assert layout.
Slow; needs network + disk space.
cmds:
- sudo bash test/e2e/disks.sh --mode full --layout {{.LAYOUT}} --fs {{.FS}} --disk1-size 12G --extra-size 6G
iso:
desc: >-
Download the pinned Arch live ISO into the gitignored .iso/ cache. Skipped
when the ISO is already present (no re-download). Override the build with
`task iso ISO_VERSION=YYYY.MM.DD`.
cmds:
- mkdir -p .iso
- curl -fL --progress-bar -o {{.ISO_PATH}} https://archive.archlinux.org/iso/{{.ISO_VERSION}}/{{.ISO_FILE}}
generates:
- '{{.ISO_PATH}}'
status:
- test -f {{.ISO_PATH}}
# vm / vm-fresh / vm-disk: INTERACTIVE, graphical QEMU for poking by hand (boot
# the live ISO and run archwright yourself, or boot the installed disk to look
# around). For unattended pass/fail validation use `vm-e2e` (below) instead.
vm:
desc: "Interactive QEMU: boot the Arch live ISO and run Phase A by hand (automated: vm-e2e)."
deps: [iso]
cmds:
- ARCH_ISO={{.ISO_PATH}} bash test/vm.sh iso
vm-fresh:
desc: "Interactive QEMU: boot the live ISO, wiping the virtual disks first."
deps: [iso]
cmds:
- ARCH_ISO={{.ISO_PATH}} bash test/vm.sh iso --fresh
vm-disk:
desc: "Interactive QEMU: boot the installed system off disk 1 (post-install poking)."
cmds:
- bash test/vm.sh disk
vm-e2e:
desc: >-
Fully automated VM e2e: boot ISO headless, run Phase A install, inject the
Phase B autorun scaffold, reboot, run bootstrap + validation. Pass a
descriptor name to run one (e.g. `task vm-e2e -- lvm-multi`); no arg runs the
whole matrix. Add `-- --jobs 5` (or `-j 5`) to run several VMs at once.
deps: [iso]
cmds:
- ARCH_ISO={{.ISO_PATH}} python3 test/e2e/vm/e2e.py {{.CLI_ARGS}}
vm-e2e-list:
desc: List the VM e2e matrix descriptors.
cmds:
- python3 test/e2e/vm/e2e.py --list