Skip to content

Commit 134af09

Browse files
committed
ci: use root to run make test
Signed-off-by: Qinqi Qu <quqinqi@linux.alibaba.com>
1 parent 43c61f2 commit 134af09

File tree

2 files changed

+27
-24
lines changed

2 files changed

+27
-24
lines changed

.github/workflows/rust.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ jobs:
4343
if: ${{ matrix.arch == 'amd64' }}
4444
run: |
4545
echo user_allow_other | sudo tee --append /etc/fuse.conf
46-
make test
47-
make smoke-all
46+
CARGO_HOME=${HOME}/.cargo
47+
CARGO_BIN=$(which cargo)
48+
sudo -E CARGO=${CARGO_BIN} make test
49+
sudo -E CARGO=${CARGO_BIN} make smoke-all
4850
4951
Macos-CI:
5052
runs-on: macos-latest
@@ -56,7 +58,8 @@ jobs:
5658
sudo installer -pkg fuse-t-macos-installer-1.0.24.pkg -target /
5759
- uses: actions/checkout@v3
5860
- name: build and check
59-
run: make smoke-macos
61+
run: |
62+
make smoke-macos
6063
6164
deny:
6265
name: Cargo Deny

Makefile

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,42 +21,42 @@ check: build
2121
${CARGO} clippy ${TARGET} --features="fusedev,virtiofs" --no-default-features -- -Dwarnings
2222

2323
test:
24-
cargo test ${TARGET} --features="fusedev" --no-default-features -- --nocapture --skip integration
25-
cargo test ${TARGET} --features="virtiofs" --no-default-features -- --nocapture --skip integration
26-
cargo test ${TARGET} --features="vhost-user-fs" --no-default-features -- --nocapture --skip integration
27-
cargo test ${TARGET} --features="fusedev,virtiofs" --no-default-features -- --nocapture --skip integration
28-
cargo test ${TARGET} --features="fusedev,async-io" --no-default-features -- --nocapture --skip integration
29-
cargo test ${TARGET} --features="virtiofs,async-io" --no-default-features -- --nocapture --skip integration
30-
cargo test ${TARGET} --features="vhost-user-fs,async-io" --no-default-features -- --nocapture --skip integration
31-
cargo test ${TARGET} --features="fusedev,virtiofs,async-io" --no-default-features -- --nocapture --skip integration
32-
cargo test ${TARGET} --features="fusedev,persist" --no-default-features -- --nocapture --skip integration
33-
cargo test ${TARGET} --all-features -- --nocapture --skip integration
24+
${CARGO} test ${TARGET} --features="fusedev" --no-default-features -- --nocapture --skip integration
25+
${CARGO} test ${TARGET} --features="virtiofs" --no-default-features -- --nocapture --skip integration
26+
${CARGO} test ${TARGET} --features="vhost-user-fs" --no-default-features -- --nocapture --skip integration
27+
${CARGO} test ${TARGET} --features="fusedev,virtiofs" --no-default-features -- --nocapture --skip integration
28+
${CARGO} test ${TARGET} --features="fusedev,async-io" --no-default-features -- --nocapture --skip integration
29+
${CARGO} test ${TARGET} --features="virtiofs,async-io" --no-default-features -- --nocapture --skip integration
30+
${CARGO} test ${TARGET} --features="vhost-user-fs,async-io" --no-default-features -- --nocapture --skip integration
31+
${CARGO} test ${TARGET} --features="fusedev,virtiofs,async-io" --no-default-features -- --nocapture --skip integration
32+
${CARGO} test ${TARGET} --features="fusedev,persist" --no-default-features -- --nocapture --skip integration
33+
${CARGO} test ${TARGET} --all-features -- --nocapture --skip integration
3434

3535
smoke:
36-
cargo test ${TARGET} --features="fusedev,persist" -- --nocapture
36+
${CARGO} test ${TARGET} --features="fusedev,persist" -- --nocapture
3737

3838
smoke-all: smoke
39-
cargo test ${TARGET} --features="fusedev,persist" -- --nocapture --ignored
39+
${CARGO} test ${TARGET} --features="fusedev,persist" -- --nocapture --ignored
4040

4141
build-macos:
42-
cargo build --features="fusedev"
43-
cargo build --features="fusedev,fuse-t"
42+
${CARGO} build --features="fusedev"
43+
${CARGO} build --features="fusedev,fuse-t"
4444

4545
check-macos: build-macos
46-
cargo fmt -- --check
47-
cargo clippy --features="fusedev" -- -Dwarnings
48-
cargo test --features="fusedev" -- --nocapture --skip integration
49-
cargo clippy --features="fusedev,fuse-t" -- -Dwarnings
50-
cargo test --features="fusedev,fuse-t" -- --nocapture --skip integration
46+
${CARGO} fmt -- --check
47+
${CARGO} clippy --features="fusedev" -- -Dwarnings
48+
${CARGO} test --features="fusedev" -- --nocapture --skip integration
49+
${CARGO} clippy --features="fusedev,fuse-t" -- -Dwarnings
50+
${CARGO} test --features="fusedev,fuse-t" -- --nocapture --skip integration
5151

5252
smoke-macos: check-macos
53-
cargo test --features="fusedev,fuse-t" -- --nocapture
53+
${CARGO} test --features="fusedev,fuse-t" -- --nocapture
5454

5555
docker-smoke:
5656
docker run --env RUST_BACKTRACE=1 --rm --privileged --volume ${current_dir}:/fuse-rs rust:1.68 sh -c "rustup component add clippy rustfmt; cd /fuse-rs; make smoke-all"
5757

5858
testoverlay:
59-
cd tests/testoverlay && cargo build
59+
cd tests/testoverlay && ${CARGO} build
6060

6161
# Setup xfstests env and run.
6262
xfstests:

0 commit comments

Comments
 (0)