Skip to content

Commit d628a4e

Browse files
nikhilunniclaude
andcommitted
ci: GitHub Actions with a pinned e2fsprogs oracle
Linux + macOS lanes: rustfmt, clippy -D warnings, cargo test (unit + mke2fs differential), and rustdoc -D warnings. e2fsprogs is built from the 1.47.4 tag and cached — DESIGN.md's verified claims are against that exact version, so the oracle must not float with distro packaging. The loop-mount kernel-oracle lane is reserved for the writer phase. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent a31f97d commit d628a4e

3 files changed

Lines changed: 91 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
env:
9+
# The format oracle. DESIGN.md's verified claims are against this exact
10+
# version; bumping it is a deliberate oracle upgrade, not routine chore.
11+
E2FSPROGS_VERSION: 1.47.4
12+
13+
jobs:
14+
test:
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os: [ubuntu-24.04, macos-15]
19+
runs-on: ${{ matrix.os }}
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: dtolnay/rust-toolchain@stable
24+
with:
25+
components: rustfmt, clippy
26+
27+
- uses: Swatinem/rust-cache@v2
28+
29+
- name: Cache pinned e2fsprogs
30+
uses: actions/cache@v4
31+
with:
32+
path: ~/e2fsprogs
33+
key: e2fsprogs-${{ env.E2FSPROGS_VERSION }}-${{ matrix.os }}
34+
35+
- name: Build pinned e2fsprogs
36+
run: |
37+
tools/ci-e2fsprogs.sh "$E2FSPROGS_VERSION" "$HOME/e2fsprogs"
38+
echo "E2FSPROGS_SBIN=$HOME/e2fsprogs/sbin" >> "$GITHUB_ENV"
39+
40+
- name: rustfmt
41+
run: cargo fmt --check
42+
43+
- name: clippy
44+
run: cargo clippy --all-targets -- -D warnings
45+
46+
- name: tests (unit + mke2fs differential)
47+
run: cargo test
48+
49+
- name: docs build cleanly
50+
run: cargo doc --no-deps
51+
env:
52+
RUSTDOCFLAGS: -D warnings
53+
54+
# Loop-mount kernel-oracle lane lands with the writer (phase 3): it will
55+
# mount generated images and diff the tree against the declared
56+
# namespace. Kept as a separate job so it can run privileged steps.

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# streamext4
22

3+
[![CI](https://github.com/cortexapps/mke2fs-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/cortexapps/mke2fs-rs/actions/workflows/ci.yml)
4+
35
Deterministic, streaming, pure-Rust ext4 image builder — plus a
46
verification-grade reader. No C dependencies, no kernel mounts, no clocks,
57
no RNG.

‎tools/ci-e2fsprogs.sh‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
# Build a pinned e2fsprogs into a prefix (idempotent; cache the prefix).
3+
#
4+
# The differential tests are oracle-version-sensitive: DESIGN.md's
5+
# [verified] claims are against e2fsprogs 1.47.4 exactly, so CI must not
6+
# float with distro/brew packaging.
7+
#
8+
# Usage: tools/ci-e2fsprogs.sh <version> <prefix>
9+
10+
set -euo pipefail
11+
12+
VER=$1
13+
PREFIX=$2
14+
15+
if [ -x "$PREFIX/sbin/mke2fs" ] && "$PREFIX/sbin/mke2fs" -V 2>&1 | head -1 | grep -qF "$VER"; then
16+
echo "e2fsprogs $VER already present at $PREFIX (cached)"
17+
exit 0
18+
fi
19+
20+
SRC=$(mktemp -d)
21+
trap 'rm -rf "$SRC"' EXIT
22+
23+
URL="https://mirrors.edge.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v$VER/e2fsprogs-$VER.tar.gz"
24+
echo "downloading $URL"
25+
curl -fsSL "$URL" -o "$SRC/e2fsprogs.tar.gz"
26+
tar -xzf "$SRC/e2fsprogs.tar.gz" -C "$SRC"
27+
28+
cd "$SRC/e2fsprogs-$VER"
29+
./configure --prefix="$PREFIX" --disable-nls --disable-fuse2fs >/dev/null
30+
make -j"$(nproc 2>/dev/null || sysctl -n hw.ncpu)" >/dev/null
31+
make install >/dev/null
32+
echo "installed e2fsprogs $VER to $PREFIX"
33+
"$PREFIX/sbin/mke2fs" -V

0 commit comments

Comments
 (0)