Repository navigation
68 lines (53 loc) · 1.97 KB
/
Copy pathci.yml
File metadata and controls
68 lines (53 loc) · 1.97 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
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
build-kernel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# The toolchain and target come from rust-toolchain.toml, so CI builds
# with exactly the nightly the repository is pinned to.
- name: Install pinned toolchain
run: rustup show
- name: Build kernel for RISC-V
run: cargo build --target riscv64gc-unknown-none-elf
- name: Build the filesystem crate for the host
run: cargo build -p ros-fs
test-filesystem:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pinned toolchain
run: rustup show
# .cargo/config.toml defaults to the RISC-V target, which has no test
# harness, so the host triple has to be named explicitly.
- name: Run ros-fs tests
run: cargo test -p ros-fs --target x86_64-unknown-linux-gnu
test-image-tools:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pinned toolchain
run: rustup show
# ros-fs-fuse declares forced-target = x86_64-unknown-linux-gnu, so these
# binaries only exist for Linux and land under that target directory.
- name: Build the image tools
run: cargo build -p ros-fs-fuse --bins --target x86_64-unknown-linux-gnu
- name: Pack an image and read it back
run: |
set -eu
BIN=target/x86_64-unknown-linux-gnu/debug
mkdir -p /tmp/apps
printf 'hello from ros-fs\n' > /tmp/apps/hello
echo "--- pack ---"
"$BIN/ros-fs-fuse" --app hello --target /tmp/apps --output /tmp/fs.img
echo "--- inspect ls ---"
"$BIN/inspect" ls /tmp/fs.img | tee /tmp/ls.txt
grep -qx hello /tmp/ls.txt
echo "--- inspect cat ---"
"$BIN/inspect" cat /tmp/fs.img hello > /tmp/out.txt
diff /tmp/apps/hello /tmp/out.txt
echo "round trip verified"