Skip to content

Ci setup #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 56 commits into from
Jul 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
d56a419
rust initial commit
mdrazak2001 Jun 19, 2025
08426b8
update some rust
mdrazak2001 Jun 19, 2025
0b78985
add python sdk
mdrazak2001 Jun 19, 2025
a7b97a6
added nodes and edges fetch in rust
mdrazak2001 Jun 19, 2025
1e5e314
add additional rust implementations
mdrazak2001 Jun 22, 2025
b4ebea7
Rename crate to causalgraphs and wire up Python bindings
mdrazak2001 Jun 23, 2025
e1d3898
Add initial implementation of causalgraphs with RustDAG and Python bi…
mdrazak2001 Jun 23, 2025
7df66ee
Merge branch 'rust-backend-integration' of https://github.com/mdrazak…
mdrazak2001 Jun 23, 2025
3042681
add requirements.txt
mdrazak2001 Jun 23, 2025
bc39e80
update README.md
mdrazak2001 Jun 26, 2025
677ed4f
conditional compilation: create python, js cargo features
mdrazak2001 Jun 28, 2025
15efc47
fix get random wasm compilation
mdrazak2001 Jun 28, 2025
4539126
fix wasm compilation issue
mdrazak2001 Jun 28, 2025
e595d87
js runtime tests
mdrazak2001 Jun 28, 2025
92ce6e5
Refactor project structure: separate Rust core and Python bindings, r…
mdrazak2001 Jul 2, 2025
5bfe3bb
clean up
mdrazak2001 Jul 2, 2025
62efcd0
Merge branch 'rust-backend-integration' into js-bindings-wasm
mdrazak2001 Jul 2, 2025
46bce99
Restructure wasm_bindings module with initial setup and dependencies
mdrazak2001 Jul 3, 2025
9bfc7d6
Refactors:
mdrazak2001 Jul 3, 2025
438a47a
Refactor ancestor retrieval in RustDAG
mdrazak2001 Jul 4, 2025
9dedaff
Merge branch 'rust-backend-integration' into js-bindings-wasm
mdrazak2001 Jul 4, 2025
3dbf9dc
refactor `add_nodes_from` & test-wasm.js
mdrazak2001 Jul 4, 2025
46daced
Update pyo3 version to 0.21.2 and clean up imports in RustDAG
mdrazak2001 Jul 4, 2025
cd41a99
remove old js folder
mdrazak2001 Jul 4, 2025
2117242
Merge branch 'rust-backend-integration' into js-bindings-wasm
mdrazak2001 Jul 4, 2025
f720958
update README.md's
mdrazak2001 Jul 4, 2025
34a0201
Merge pull request #1 from mdrazak2001/js-bindings-wasm
mdrazak2001 Jul 4, 2025
13c6c53
initial r bindings changes
mdrazak2001 Jul 5, 2025
a9b2c05
R bindings: extendr setup https://extendr.github.io/user-guide/r-pkgs…
mdrazak2001 Jul 5, 2025
8026028
R build + Ugly Temp Fixes
mdrazak2001 Jul 5, 2025
a1c1018
Revert dirty fixes by updating R bindings and configuration for compa…
mdrazak2001 Jul 5, 2025
2ac6b01
revert config.R temp change
mdrazak2001 Jul 5, 2025
7ad020a
Merge branch 'main' into r-bindings-new
mdrazak2001 Jul 6, 2025
a4cc361
add readme
mdrazak2001 Jul 6, 2025
b9454ca
update README.md
mdrazak2001 Jul 6, 2025
0fcecbb
R remote installable by updating rust_core dependency
mdrazak2001 Jul 10, 2025
0a82429
Add MakeFile & test setup
mdrazak2001 Jul 12, 2025
f539823
ci initial setup
mdrazak2001 Jul 12, 2025
779fdab
Enable manual triggering of CI workflow
mdrazak2001 Jul 12, 2025
e7b5f85
Update Python bindings installation in Makefile to use maturin releas…
mdrazak2001 Jul 12, 2025
cf278eb
Add installation step for wasm-pack in CI workflow
mdrazak2001 Jul 12, 2025
8ed97d5
r deps change
mdrazak2001 Jul 12, 2025
c2d73ed
r deps update 2
mdrazak2001 Jul 12, 2025
68818b9
R devtools install step
mdrazak2001 Jul 12, 2025
005bf18
add system dependencies
mdrazak2001 Jul 12, 2025
8a7c1e8
add pytest installation
mdrazak2001 Jul 12, 2025
a8fe36c
macos test
mdrazak2001 Jul 13, 2025
b44154b
refactor
mdrazak2001 Jul 13, 2025
0a6628a
refactor: ci: update CI configuration for macOS
mdrazak2001 Jul 13, 2025
9e966d5
update README.md
mdrazak2001 Jul 13, 2025
dfe9195
Merge branch 'r-bindings-new' into feat/Makefile-And-Test-setup
mdrazak2001 Jul 13, 2025
960d031
Merge branch 'r-bindings-new' into ci-setup
mdrazak2001 Jul 13, 2025
f543c6b
update README.md
mdrazak2001 Jul 13, 2025
256e266
Merge branch 'feat/Makefile-And-Test-setup' into ci-setup
mdrazak2001 Jul 13, 2025
af59ba6
test
mdrazak2001 Jul 13, 2025
da20d70
Merge branch 'main' into ci-setup
ankurankan Jul 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]

steps:
- name: Checkout code
uses: actions/checkout@v4

# Setup: Toolchains
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
override: true

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "18"

- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: "4.5"

# OS-specific system dependencies (Linux only)
- name: Install system dependencies (Linux only)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
libcurl4-openssl-dev \
libssl-dev \
libfontconfig1-dev \
libfreetype6-dev \
libharfbuzz-dev \
libfribidi-dev \
libpng-dev \
libtiff5-dev \
libjpeg-dev

# Node dependencies
- name: Install JS dependencies
working-directory: wasm_bindings
run: npm ci

# Python dependencies
- name: Install Python dependencies
working-directory: python_bindings
run: |
pip install --upgrade pip
pip install maturin pytest

# R dependencies (Linux only)
- name: Install R dependencies (Linux only)
if: runner.os == 'Linux'
run: |
sudo apt-get install -y libcurl4-openssl-dev libssl-dev
Rscript -e 'install.packages(c("devtools", "rextendr"), repos="https://cloud.r-project.org")'

# Build all bindings (Rust, Python, WASM, R)
- name: Build all components
run: make all

# Run full test suite
- name: Run full test suite
run: make test
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,18 @@ core:

python: core
@echo "\n=== Building Python Bindings ==="
cd $(PY_BINDINGS) && maturin develop --release
cd $(PY_BINDINGS) && \
pip install -r requirements.txt && \
maturin build --release --out target/wheels && \
pip install target/wheels/*.whl

wasm: core
@echo "\n=== Building WebAssembly Bindings ==="
# ensure wasm-pack is in PATH (installs it 1st time only)
@if ! command -v wasm-pack >/dev/null 2>&1; then \
echo "→ Installing wasm-pack…"; \
cargo install wasm-pack; \
fi
cd $(WASM_BINDINGS) && \
npm install && \
npm run build && \
Expand All @@ -28,7 +36,9 @@ wasm: core
r: core
@echo "\n=== Building R Bindings ==="
cd $(R_BINDINGS) && \
Rscript -e "rextendr::document()"
Rscript -e "if(!require('devtools')) install.packages('devtools', repos='https://cloud.r-project.org')" && \
Rscript -e "if(!require('rextendr')) install.packages('rextendr', repos='https://cloud.r-project.org')" && \
Rscript -e "rextendr::document()"

install: python wasm r

Expand Down
43 changes: 24 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,37 @@ To build and develop this project locally, you will need:
* [R 4.2+](https://www.r-project.org/)
* [make](https://www.gnu.org/software/make/) (usually pre-installed on Linux/macOS, available via build tools on Windows)

## Supported Platforms

This library is actively developed and tested on:
- **Windows** (via WSL, or native MSVC toolchain for Rust + Rtools for R)
- **Linux** (Ubuntu, other distros)
- **macOS**

## Quick Start

### Rust
We provide a top‑level `Makefile` to save you typing:

- **Build everything** (Rust core + Python + WASM + R):

```sh
cd rust_core
cargo test
```
```sh
make all
```

### Python
- **Run all tests**:

```sh
cd python_bindings
maturin develop
python -c "import causalgraphs; print(dir(causalgraphs))"
```
```sh
make test
```

### WebAssembly (Node.js)
| Target | What it does |
| ------------- | ------------------------------------------------ |
| `make core` | Builds only the `rust_core` crate. |
| `make python` | Builds & installs Python bindings. |
| `make wasm` | Builds WASM modules for JS/Node via wasm-pack |
| `make r` | Generates R wrappers via `rextendr::document()`. |

```sh
cd wasm_bindings
npm install
npm run build
npm run test
```

## License

MIT
MIT