Skip to content

Commit c3e48e5

Browse files
committed
Implemented Github Actions for Mac and Added Mac Compatibility
1 parent 1997bdc commit c3e48e5

File tree

6 files changed

+550
-6
lines changed

6 files changed

+550
-6
lines changed

.github/workflows/build_linux.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Rust CI on Linux
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
workflow_dispatch:
9+
10+
env:
11+
CARGO_TERM_COLOR: always
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Cache Cargo registry and build artifacts
20+
uses: actions/cache@v4
21+
with:
22+
path: |
23+
~/.cargo/registry
24+
~/.cargo/git
25+
target
26+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
27+
restore-keys: |
28+
${{ runner.os }}-cargo-
29+
30+
- name: Set up Rust toolchain
31+
uses: actions-rs/toolchain@v1
32+
with:
33+
toolchain: stable
34+
override: true
35+
36+
- name: Build
37+
run: cargo build --verbose
38+
39+
- name: Run tests
40+
run: cargo test --verbose
41+
42+
- name: Build examples
43+
run: |
44+
for example in $(ls examples/*.rs); do
45+
name=$(basename "$example" .rs)
46+
echo "Building example: $name"
47+
cargo build --example "$name" --verbose
48+
done
49+

.github/workflows/build_mac.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,12 @@ jobs:
3838

3939
- name: Run tests
4040
run: cargo test --verbose
41+
42+
- name: Build examples
43+
run: |
44+
for example in $(ls examples/*.rs); do
45+
name=$(basename "$example" .rs)
46+
echo "Building example: $name"
47+
cargo build --example "$name" --verbose
48+
done
49+

Cargo.lock

Lines changed: 105 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ tracing = "0.1"
1717
thiserror = "1.0"
1818
nix = { version = "0.29", features = ["signal", "process"] } # For killpg
1919
libc = "0.2" # For setpgid and signal constants
20-
2120
# Dependencies also used by the example(s)
2221
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] } # For logging setup
2322
tempfile = "3" # For creating temporary directories in examples/tests
2423
anyhow = "1.0" # For simple error handling in examples
24+
futures = "0.3" # For simulataneous_git_clone example
2525
# Dependency on the library itself (needed for building examples within the workspace)
2626
# This line might not be strictly necessary if cargo automatically detects it,
2727
# but explicitly listing it can sometimes help.
@@ -39,4 +39,11 @@ anyhow = "1.0" # For simple error handling in examples
3939
name = "git_clone_kernel"
4040
path = "examples/git_clone_kernel.rs"
4141
# Example requires tokio runtime features if not enabled globally in [dependencies]
42-
# required-features = ["full"] # Uncomment if tokio features are restricted in [dependencies]
42+
# required-features = ["full"] # Uncomment if tokio features are restricted in [dependencies]
43+
44+
# Declare the example binary target
45+
[[example]]
46+
name = "simultaneous_git_clone"
47+
path = "examples/simultaneous_git_clone.rs"
48+
# Example requires tokio runtime features if not enabled globally in [dependencies]
49+
# required-features = ["full"] # uncomment if tokio features are restricted in [dependencies]

0 commit comments

Comments
 (0)