forked from GitHub/bdwgc-rust
Refactor project structure (#507)
This commit is contained in:
4
.github/workflows/lint.yaml
vendored
4
.github/workflows/lint.yaml
vendored
@@ -11,7 +11,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: swatinem/rust-cache@v2
|
||||||
- run: cargo clippy -- -D warnings
|
- run: cargo clippy -- -D warnings
|
||||||
format:
|
format:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -30,5 +30,3 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
- uses: lycheeverse/lychee-action@v2
|
- uses: lycheeverse/lychee-action@v2
|
||||||
with:
|
|
||||||
fail: true
|
|
||||||
|
|||||||
2
.github/workflows/release.yaml
vendored
2
.github/workflows/release.yaml
vendored
@@ -17,7 +17,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- uses: raviqqe/cargo-cache@v1
|
- uses: swatinem/rust-cache@v2
|
||||||
- run: cargo install cargo-workspaces
|
- run: cargo install cargo-workspaces
|
||||||
- uses: rust-lang/crates-io-auth-action@v1
|
- uses: rust-lang/crates-io-auth-action@v1
|
||||||
id: auth
|
id: auth
|
||||||
|
|||||||
10
.github/workflows/test.yaml
vendored
10
.github/workflows/test.yaml
vendored
@@ -11,7 +11,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: swatinem/rust-cache@v2
|
||||||
- run: cargo build
|
- run: cargo build
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -19,7 +19,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: swatinem/rust-cache@v2
|
||||||
- run: cargo test
|
- run: cargo test
|
||||||
examples:
|
examples:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -27,13 +27,13 @@ jobs:
|
|||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: swatinem/rust-cache@v2
|
||||||
- run: examples/test.sh
|
- run: tools/example_test.sh
|
||||||
cmake:
|
cmake:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: swatinem/rust-cache@v2
|
||||||
- run: cargo build --no-default-features --features cmake
|
- run: cargo build --no-default-features --features cmake
|
||||||
|
|||||||
28
Cargo.lock
generated
28
Cargo.lock
generated
@@ -39,12 +39,33 @@ dependencies = [
|
|||||||
"cc",
|
"cc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "dynamic_threads"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"bdwgc-alloc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "find-msvc-tools"
|
name = "find-msvc-tools"
|
||||||
version = "0.1.5"
|
version = "0.1.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844"
|
checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "free_by_borrow"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"bdwgc-alloc",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "free_by_gc"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"bdwgc-alloc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.178"
|
version = "0.2.178"
|
||||||
@@ -56,3 +77,10 @@ name = "shlex"
|
|||||||
version = "1.3.0"
|
version = "1.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "static_threads"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"bdwgc-alloc",
|
||||||
|
]
|
||||||
|
|||||||
@@ -7,6 +7,10 @@ repository = "https://github.com/raviqqe/bdwgc-alloc"
|
|||||||
license = "MIT"
|
license = "MIT"
|
||||||
categories = ["api-bindings", "memory-management", "no-std", "no-std::no-alloc"]
|
categories = ["api-bindings", "memory-management", "no-std", "no-std::no-alloc"]
|
||||||
|
|
||||||
|
[workspace]
|
||||||
|
resolver = "3"
|
||||||
|
members = ["examples/*"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
libc = "0.2.178"
|
libc = "0.2.178"
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
"repr",
|
"repr",
|
||||||
"rustc",
|
"rustc",
|
||||||
"stackbottom",
|
"stackbottom",
|
||||||
|
"swatinem",
|
||||||
"unregisters"
|
"unregisters"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
63
examples/Cargo.lock
generated
63
examples/Cargo.lock
generated
@@ -1,63 +0,0 @@
|
|||||||
# This file is automatically @generated by Cargo.
|
|
||||||
# It is not intended for manual editing.
|
|
||||||
version = 4
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "autotools"
|
|
||||||
version = "0.2.7"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ef941527c41b0fc0dd48511a8154cd5fc7e29200a0ff8b7203c5d777dbc795cf"
|
|
||||||
dependencies = [
|
|
||||||
"cc",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "bdwgc-alloc"
|
|
||||||
version = "0.6.12"
|
|
||||||
dependencies = [
|
|
||||||
"autotools",
|
|
||||||
"libc",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "cc"
|
|
||||||
version = "1.0.83"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0"
|
|
||||||
dependencies = [
|
|
||||||
"libc",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "dynamic_threads"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"bdwgc-alloc",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "free_by_borrow"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"bdwgc-alloc",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "free_by_gc"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"bdwgc-alloc",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "libc"
|
|
||||||
version = "0.2.178"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "static_threads"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"bdwgc-alloc",
|
|
||||||
]
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
[workspace]
|
|
||||||
resolver = "3"
|
|
||||||
members = [
|
|
||||||
"dynamic_threads",
|
|
||||||
"free_by_borrow",
|
|
||||||
"free_by_gc",
|
|
||||||
"static_threads",
|
|
||||||
]
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
cd $(dirname $0)
|
|
||||||
|
|
||||||
for cargo_file in */Cargo.toml; do
|
|
||||||
cargo run --bin $(dirname $cargo_file) &
|
|
||||||
pid=$!
|
|
||||||
sleep 20
|
|
||||||
kill $pid
|
|
||||||
done
|
|
||||||
20
tools/example_test.sh
Executable file
20
tools/example_test.sh
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
duration=20
|
||||||
|
|
||||||
|
cd $(dirname $0)/..
|
||||||
|
|
||||||
|
for directory in $(ls examples); do
|
||||||
|
(
|
||||||
|
cd examples/$directory
|
||||||
|
|
||||||
|
cargo build
|
||||||
|
cargo run &
|
||||||
|
|
||||||
|
pid=$!
|
||||||
|
sleep $duration
|
||||||
|
kill $pid
|
||||||
|
)
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user