diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml index 5a0cf852060..7522029f1d2 100644 --- a/.github/workflows/smoke.yml +++ b/.github/workflows/smoke.yml @@ -610,9 +610,13 @@ jobs: shared-key: nydus-build - name: Install cargo nextest uses: taiki-e/install-action@nextest + - name: Fscache Setup + run: sudo bash misc/fscache/setup.sh - name: Unit Test run: | - make ut-nextest + CARGO_HOME=${HOME}/.cargo + CARGO_BIN=$(which cargo) + sudo -E CARGO=${CARGO_BIN} make ut-nextest nydus-unit-test-coverage: runs-on: ubuntu-latest @@ -626,8 +630,13 @@ jobs: cache-on-failure: true - name: Install cargo-llvm-cov uses: taiki-e/install-action@cargo-llvm-cov + - name: Fscache Setup + run: sudo bash misc/fscache/setup.sh - name: Generate code coverage - run: make coverage-codecov + run: | + CARGO_HOME=${HOME}/.cargo + CARGO_BIN=$(which cargo) + sudo -E CARGO=${CARGO_BIN} make coverage-codecov - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: diff --git a/misc/fscache/setup.sh b/misc/fscache/setup.sh new file mode 100644 index 00000000000..da312b53ece --- /dev/null +++ b/misc/fscache/setup.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# This script should be executed in root mode! + +apt update +apt install -y cachefilesd +apt list --installed | grep cachefilesd +chmod a+w /etc/default/cachefilesd +sed -i 's/#RUN=yes/RUN=yes/' /etc/default/cachefilesd +cat /etc/default/cachefilesd +/sbin/modprobe -qab cachefiles +/sbin/cachefilesd -f /etc/cachefilesd.conf +systemctl status cachefilesd +[ -c /dev/cachefiles ] && echo "cachefilesd is successfully enabled" +pid=$(lsof /dev/cachefiles | awk '{if (NR>1) {print $2}}') +kill -9 $pid +echo "/dev/cachefiles is available now"