feat: Add CI/CD workflows for testing and publishing SAL crates
Some checks failed
Test Publishing Setup / Test Publishing Setup (pull_request) Has been cancelled

- Add a workflow for testing the publishing setup
- Add a workflow for publishing SAL crates to crates.io
- Improve crate metadata and version management
- Add optional dependencies for modularity
- Improve documentation for publishing and usage
This commit is contained in:
Mahmoud-Emad
2025-07-01 08:34:20 +03:00
parent 52f2f7e3c4
commit e01b83f12a
29 changed files with 2823 additions and 35 deletions

View File

@@ -17,7 +17,7 @@ Add this to your `Cargo.toml`:
```toml
[dependencies]
sal-process = { path = "../process" }
sal-process = "0.1.0"
```
## Usage

View File

@@ -138,7 +138,12 @@ fn test_run_with_environment_variables() {
#[test]
fn test_run_with_working_directory() {
// Test that commands run in the current working directory
#[cfg(target_os = "windows")]
let result = run_command("cd").unwrap();
#[cfg(not(target_os = "windows"))]
let result = run_command("pwd").unwrap();
assert!(result.success);
assert!(!result.stdout.is_empty());
}
@@ -200,6 +205,16 @@ fn test_run_script_with_variables() {
#[test]
fn test_run_script_with_conditionals() {
#[cfg(target_os = "windows")]
let script = r#"
if "hello"=="hello" (
echo Condition passed
) else (
echo Condition failed
)
"#;
#[cfg(not(target_os = "windows"))]
let script = r#"
if [ "hello" = "hello" ]; then
echo "Condition passed"
@@ -215,6 +230,14 @@ fn test_run_script_with_conditionals() {
#[test]
fn test_run_script_with_loops() {
#[cfg(target_os = "windows")]
let script = r#"
for %%i in (1 2 3) do (
echo Number: %%i
)
"#;
#[cfg(not(target_os = "windows"))]
let script = r#"
for i in 1 2 3; do
echo "Number: $i"