Repository navigation
88 lines (77 loc) · 2.95 KB
/
Copy pathdisk-reader.yml
File metadata and controls
88 lines (77 loc) · 2.95 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
name: disk-reader
# The host-native disk reader uses Linux for mkfs.xfs integration tests and
# compile-checks its macOS and Windows targets separately from Pi releases.
on:
push:
branches: [main]
paths:
- 'crates/disk_reader/**'
- '.github/workflows/disk-reader.yml'
pull_request:
branches: [main]
paths:
- 'crates/disk_reader/**'
- '.github/workflows/disk-reader.yml'
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
jobs:
golden-image:
name: Golden-image integration test (Linux)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2
with:
key: disk-reader-linux
- name: Build
run: cargo build --release -p disk_reader
- name: Build golden SSD image
run: |
sudo apt-get -qq update && sudo apt-get -qq install -y xfsprogs dosfstools parted
sudo bash crates/disk_reader/tests/make_golden_image.sh golden.img
sudo chmod a+r golden.img golden.img.manifest
- name: Probe
run: ./target/release/sentryusb-disk-reader probe golden.img
- name: Verify merged tree is byte-exact vs kernel mounts
run: |
set -euo pipefail
BIN=./target/release/sentryusb-disk-reader
fail=0
while read -r want path; do
got=$($BIN cat golden.img "$path" | sha256sum | cut -d' ' -f1)
if [ "$got" != "$want" ]; then
echo "MISMATCH $path: want $want got $got"
fail=1
else
echo "ok $path"
fi
done < golden.img.manifest
count=$($BIN ls golden.img TeslaCam | wc -l)
echo "TeslaCam top-level entries: $count"
exit $fail
- name: Verify newest-wins merge semantics
run: |
set -euo pipefail
BIN=./target/release/sentryusb-disk-reader
# Merged snapshots must expose the epoch-2 event.json replacement.
$BIN cat golden.img "TeslaCam/SavedClips/2026-07-01_10-00-00/event.json" | grep -q '"camera":"3"'
# Clip C exercises live-image plus TOC-less snapshot merging.
$BIN ls golden.img "TeslaCam/RecentClips" | grep -q "2026-07-03_08-00-00-front.mp4"
echo "merge semantics ok"
cross-check:
name: cargo check (${{ matrix.target }})
strategy:
matrix:
include:
- { runs_on: macos-15, target: aarch64-apple-darwin }
- { runs_on: windows-latest, target: x86_64-pc-windows-msvc }
runs-on: ${{ matrix.runs_on }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2
with:
key: disk-reader-${{ matrix.target }}
- name: Check
run: cargo check -p disk_reader --target ${{ matrix.target }}