Skip to content

Commit 36cd288

Browse files
adamqqqplaybergwolf
authored andcommitted
ci: use root to run make test
Signed-off-by: Qinqi Qu <[email protected]>
1 parent 301e93f commit 36cd288

File tree

2 files changed

+28
-24
lines changed

2 files changed

+28
-24
lines changed

.github/workflows/rust.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@ 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
50+
sudo chown -R $(id -u):$(id -g) "${HOME}/.cargo"
4851
4952
Macos-CI:
5053
runs-on: macos-latest
@@ -56,7 +59,8 @@ jobs:
5659
sudo installer -pkg fuse-t-macos-installer-1.0.24.pkg -target /
5760
- uses: actions/checkout@v3
5861
- name: build and check
59-
run: make smoke-macos
62+
run: |
63+
make smoke-macos
6064
6165
deny:
6266
name: Cargo Deny

Makefile

+21-21
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)