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
name: CI
on:
push:
branches:
pull_request:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"
jobs:
# Linux runs the full battery: fmt, clippy, build, test, doc. The
# external cross-validation tests (e2fsck, mke2fs, sgdisk, qemu-img,
# …) only fire here because they need apt-supplied tools.
test-linux:
name: test (ubuntu)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install system tools
run: |
sudo apt-get update
sudo apt-get install -y \
gdisk \
fdisk \
e2fsprogs \
genext2fs \
dosfstools \
mtools \
qemu-utils
# Sanity-check that everything we cross-validate against is on PATH.
which sgdisk
which fdisk
which e2fsck
which debugfs
which mke2fs
which genext2fs
which fsck.vfat
which mdir
which mtype
which qemu-img
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: cargo fmt --check
run: cargo fmt --all -- --check
- name: cargo clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: cargo build
run: cargo build --all-targets --verbose
- name: cargo test
run: cargo test --all-targets --verbose
- name: cargo doc
run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: "-D warnings"
# macOS proves the lib + CLI compile and unit-test cleanly on a
# non-Linux Unix. `qemu-img` is available via Homebrew so the qcow2
# round-trip suite runs here too; sgdisk / e2fsck / mke2fs / mtools
# aren't packaged in stock Homebrew, so those tests skip themselves.
test-macos:
name: test (macos)
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
- name: Install qemu (for qcow2 tests)
run: brew install qemu
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: cargo build
run: cargo build --all-targets --verbose
- name: cargo test
run: cargo test --all-targets --verbose
# Windows proves the Unix-only paths in populate_from_host_dir /
# build_plan / file.rs are properly cfg-gated. Almost all external
# cross-validation tests skip here (their tools aren't on the runner),
# which is the contract: the in-process tests must still pass.
test-windows:
name: test (windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: cargo build
run: cargo build --all-targets --verbose
- name: cargo test
run: cargo test --all-targets --verbose