rearranging ffi mods, adding wasm and python builds
This commit is contained in:
parent
a567bcffaf
commit
37f4d8f84c
@ -72,10 +72,53 @@ jobs:
|
|||||||
command: publish
|
command: publish
|
||||||
args: --package finlib
|
args: --package finlib
|
||||||
|
|
||||||
|
buildWASM:
|
||||||
|
name: Build WASM
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [ build ] # for ignoring bad builds
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
github-server-url: https://gitea.sheep-ghoul.ts.net
|
||||||
|
|
||||||
|
- name: Install Rust
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
|
||||||
|
- name: Install wasm-pack
|
||||||
|
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
||||||
|
|
||||||
|
- name: Build Rust for WASM
|
||||||
|
working-directory: ./finlib-wasm
|
||||||
|
run: wasm-pack build
|
||||||
|
|
||||||
|
buildPy:
|
||||||
|
name: Build Python
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [ build ] # for ignoring bad builds
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4 # get source
|
||||||
|
with:
|
||||||
|
github-server-url: https://gitea.sheep-ghoul.ts.net
|
||||||
|
|
||||||
|
- name: Install Python 3
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: ${{ env.python-version }}
|
||||||
|
|
||||||
|
- name: Install Maturin
|
||||||
|
run: pip3 install maturin
|
||||||
|
|
||||||
|
- name: Build Python
|
||||||
|
working-directory: ./pyfinlib
|
||||||
|
run: maturin develop
|
||||||
|
|
||||||
publishNPM:
|
publishNPM:
|
||||||
name: Publish NPM
|
name: Publish NPM
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [ build ] # for ignoring bad builds
|
needs: [ buildWASM ] # for ignoring bad builds
|
||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
8
Cargo.lock
generated
8
Cargo.lock
generated
@ -259,7 +259,7 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "finlib"
|
name = "finlib"
|
||||||
version = "0.0.1"
|
version = "0.0.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"getrandom 0.2.15",
|
"getrandom 0.2.15",
|
||||||
"log",
|
"log",
|
||||||
@ -274,7 +274,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "finlib-ffi"
|
name = "finlib-ffi"
|
||||||
version = "0.0.1"
|
version = "0.0.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cbindgen",
|
"cbindgen",
|
||||||
"csbindgen",
|
"csbindgen",
|
||||||
@ -283,7 +283,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "finlib-wasm"
|
name = "finlib-wasm"
|
||||||
version = "0.0.1"
|
version = "0.0.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"console_error_panic_hook",
|
"console_error_panic_hook",
|
||||||
"console_log",
|
"console_log",
|
||||||
@ -606,7 +606,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pyfinlib"
|
name = "pyfinlib"
|
||||||
version = "0.0.1"
|
version = "0.0.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"finlib",
|
"finlib",
|
||||||
"pyo3",
|
"pyo3",
|
||||||
|
@ -14,7 +14,7 @@ default-members = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.0.1"
|
version = "0.0.2"
|
||||||
authors = ["sarsoo <andy@sarsoo.xyz>"]
|
authors = ["sarsoo <andy@sarsoo.xyz>"]
|
||||||
description = "Quant finance functions implemented in Rust"
|
description = "Quant finance functions implemented in Rust"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
4
finlib/src/ffi/mod.rs
Normal file
4
finlib/src/ffi/mod.rs
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#[cfg(feature = "py")]
|
||||||
|
pub mod py;
|
||||||
|
#[cfg(feature = "wasm")]
|
||||||
|
pub mod wasm;
|
@ -2,7 +2,4 @@ pub mod interest;
|
|||||||
pub mod stats;
|
pub mod stats;
|
||||||
pub mod util;
|
pub mod util;
|
||||||
pub mod risk;
|
pub mod risk;
|
||||||
#[cfg(feature = "py")]
|
pub mod ffi;
|
||||||
pub mod py;
|
|
||||||
#[cfg(feature = "wasm")]
|
|
||||||
pub mod wasm;
|
|
Loading…
x
Reference in New Issue
Block a user