@@ -1034,3 +1034,48 @@ jobs:
10341034 echo "Running tests with --features=$f and --no-default-features"
10351035 cargo test --features=$f --no-default-features
10361036 done
1037+
1038+ test_selinux :
1039+ name : Build/SELinux
1040+ needs : [ min_version, deps ]
1041+ runs-on : ubuntu-latest
1042+ steps :
1043+ - uses : actions/checkout@v4
1044+ with :
1045+ persist-credentials : false
1046+ - uses : dtolnay/rust-toolchain@stable
1047+ - name : Setup Lima
1048+ uses : lima-vm/lima-actions/setup@v1
1049+ id : lima-actions-setup
1050+ - name : Cache ~/.cache/lima
1051+ uses : actions/cache@v4
1052+ with :
1053+ path : ~/.cache/lima
1054+ key : lima-${{ steps.lima-actions-setup.outputs.version }}
1055+ - name : Start Fedora VM with SELinux
1056+ run : limactl start --plain --name=default --cpus=1 --disk=30 --memory=4 --network=lima:user-v2 template://fedora
1057+ - name : Setup SSH
1058+ uses : lima-vm/lima-actions/ssh@v1
1059+ - name : Setup Rust in VM
1060+ run : |
1061+ lima sudo dnf install gcc g++ git rustup libselinux-devel clang -y
1062+ lima rustup-init -y --default-toolchain stable
1063+ - name : Verify SELinux Status
1064+ run : |
1065+ lima getenforce
1066+ lima ls -laZ /etc/selinux
1067+ - name : Free up disk space in VM
1068+ run : |
1069+ lima df -h
1070+ # Remove unnecessary packages and clear package cache
1071+ lima sudo dnf clean all
1072+ lima df -h
1073+ - name : Clone Repository
1074+ run : |
1075+ lima git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY $LIMA_HOME/coreutils
1076+ - name : Build and Test with SELinux
1077+ env :
1078+ LIMA_WORKDIR : $LIMA_HOME/coreutils
1079+ run : |
1080+ lima df -h
1081+ lima cargo test --features "feat_selinux"
0 commit comments