Skip to content

Commit 3e14436

Browse files
committed
Run the tests with sudo
As FeOS being a PID1 and needing root access to be able to function, run the tests also with sudo to have a similar environment. Signed-off-by: Guvenc Gulce <[email protected]>
1 parent 1bbfa63 commit 3e14436

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

.github/workflows/test.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,21 @@ jobs:
2727
restore-keys: ${{ runner.os }}-cargo-
2828

2929
- name: Run Tests
30-
run: make test
30+
env:
31+
RUST_BACKTRACE: 1
32+
SUDO_ENV_VARS: "PATH=$PATH:$HOME/.cargo/bin CARGO_HOME=$HOME/.cargo"
33+
run: |
34+
# Explicitly export variables within a sudo-executed shell command
35+
# This ensures PATH and CARGO_HOME are set correctly *in the context* where make runs.
36+
sudo -E bash -c ' \
37+
export PATH="$HOME/.cargo/bin:$PATH"; \
38+
export CARGO_HOME="$HOME/.cargo"; \
39+
echo "--- Debug Info ---"; \
40+
echo "User: $(whoami)"; \
41+
echo "Home: $HOME"; \
42+
echo "Cargo Home: $CARGO_HOME"; \
43+
echo "Path: $PATH"; \
44+
echo "Which Cargo: $(which cargo)"; \
45+
echo "--- Running Make Test ---"; \
46+
make test \
47+
'

0 commit comments

Comments
 (0)