Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: CI

on:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install toolchains, rapido and xfstests dependencies
run: |
sudo apt-get update -y
# cargo default package is v1.75, which doesn't support v4 lock files
sudo apt-get install -y --no-install-recommends --no-install-suggests \
cargo-1.85 rustc qemu-system-x86 qemu-utils \
make flex bison libelf-dev acl attr automake bc dbench dump \
e2fsprogs fio gawk libtool sed libgdbm-compat-dev \
gcc git indent libacl1-dev libaio-dev libcap-dev libgdbm-dev \
libtool-bin liburing-dev libuuid1 lvm2 make psmisc python3 quota \
uuid-dev uuid-runtime xfsprogs linux-headers-$(uname -r) sqlite3 \
xfsdump xfslibs-dev btrfs-progs pkg-config
# chmod /dev/kvm to allow non-root QEMU to use it.
# chmod needs to go after install, as udev may be triggered.
sudo chmod 0666 /dev/kvm
# TODO: https://github.com/rapido-linux/rapido once rs_wip is merged
git clone --depth 1 -b rs_wip https://github.com/ddiss/rapido \
${HOME}/rapido
pushd ${HOME}/rapido
cargo-1.85 build --offline --release
popd
- name: build mainline kernel and xfstests
run: |
cp ${HOME}/rapido/kernel/fstests_btrfs_zram.defconfig .config
make olddefconfig
make -j$(nproc)
make modules_install INSTALL_MOD_PATH=./mods
# this gives us modules.dep, etc. which rapido needs.
# XXX should come with modules_install but doesn't... perhaps due to no modules?
objtree=./ INSTALL_MOD_PATH=./mods ./scripts/depmod.sh \
"$(cat include/config/kernel.release)"
git clone --depth 1 -b master \
https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git \
${HOME}/xfstests
pushd ${HOME}/xfstests
make -j$(nproc)
popd
- name: boot mainline kernel and run xfstests
run: |
linux_dir="${PWD}"
pushd ${HOME}/rapido
# rapido fstests-btrfs uses 5x guest-zram-dev by default (for raid),
# but we probably don't have enough memory. Use compressed qcow2:
test_img="${HOME}/fstests_test_zstd.qcow2"
scratch_img="${HOME}/fstests_scratch_zstd.qcow2"
qemu-img create -f qcow2 -o compression_type=zstd "$test_img" 8G
qemu-img create -f qcow2 -o compression_type=zstd "$scratch_img" 8G
mkdir -p "${HOME}/9p"
cat > rapido.conf <<EOF
KERNEL_SRC=${linux_dir}
KERNEL_INSTALL_MOD_PATH=${linux_dir}/mods
FSTESTS_SRC=${HOME}/xfstests
FSTESTS_ZRAM_SIZE=0
VIRTFS_SHARE_PATH=${HOME}/9p
EOF
printf 'QEMU_EXTRA_ARGS="-nographic -device virtio-rng-pci -drive id=test,file='"$test_img"',if=none,cache=none -device virtio-blk-pci,drive=test,bus=pci.0,serial=TEST_DEV -drive id=scratch,file='"$scratch_img"',if=none,cache=none -device virtio-blk-pci,drive=scratch,bus=pci.0,serial=SCRATCH_DEV"' \
>> rapido.conf
cat rapido.conf
./rapido cut \
-x "./check -R xunit -g quick; cp results/result.xml /host/; exit" \
fstests-btrfs
popd
- name: dump results
run: |
cat "${HOME}/9p/result.xml"
- name: Archive xunit test results
uses: actions/upload-artifact@v4
with:
name: xunit-results
path: ~/9p/result.xml
retention-days: 2