Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .github/actions-rs/grcov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
output-type: html
137 changes: 137 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
name: Continuous Integration

on: [ push ]

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Clone repo
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt, clippy

- name: Release build
uses: actions-rs/cargo@v1
with:
command: build
args: --release --all-features

- name: Install cargo-audit binary crate
uses: actions-rs/install@v0.1
with:
crate: cargo-audit
version: latest
use-tool-cache: true

- name: Annotate commit with clippy warnings
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features

- name: Security audit
uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

coverage:
needs: build
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v4
with:
submodules: recursive

- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true

- uses: actions-rs/cargo@v1
name: Run test with code coverage report
with:
command: test
args: --all-features --no-fail-fast
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'

- id: coverage
name: Collect code coverage
uses: actions-rs/grcov@v0.1

- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: ${{ steps.coverage.outputs.report }}

release:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs: coverage
steps:
- name: Clone repo
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: wasm32-wasi

- name: Run Release PR
uses: MarcoIeni/release-plz-action@v0.5
with:
command: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

build-cli:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]

runs-on: ${{ matrix.os }}
needs: coverage
steps:
- name: Clone repo
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable

- name: Release build
uses: actions-rs/cargo@v1
with:
command: build
args: --release --bin cli

- name: Upload target binary
uses: actions/upload-artifact@v4
with:
name: cli-${{ matrix.os }}
path: target/release/cli
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "sdk"]
path = sdk
url = git@github.com:G-Core/FastEdge-sdk-rust.git
59 changes: 59 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[workspace]
members = ["crates/*"]
resolver = "2"

[workspace.package]
version = "0.3.7"
edition = "2021"
publish = false
authors = ["FastEdge Development Team"]

[workspace.dependencies]
tokio = { version = "1", features = ["full"] }
tokio-util = { version = "0.7", features = ["codec"] }
tracing = "0.1"
hyper = { version = "0.14", features = ["full"] }
http = "0.2.9"
async-trait = "0.1"
wasmtime = { version = "20.0" }
wasmtime-wasi = { version = "20.0" }
wasi-common = { version = "20.0" }
wasmtime-wasi-nn = { version = "20.0" }
clap = { version = "4", features = ["derive"] }
moka = { version = "0.12", features = ["sync"] }
smol_str = "0.2.1"
anyhow = "1.0"


[workspace.lints.rust]
unused_extern_crates = 'warn'
trivial_numeric_casts = 'warn'
unstable_features = 'warn'
unused_import_braces = 'warn'

[workspace.lints.clippy]
all = 'allow'

[package]
name = "cli"
version.workspace = true
edition.workspace = true
publish.workspace = true
authors.workspace = true


[dependencies]
anyhow = { workspace = true }
hyper = { workspace = true }
http = { workspace = true }
tokio = { workspace = true }
tokio-util = { workspace = true }
wasmtime = { workspace = true }
wasmtime-wasi = { workspace = true }
smol_str = { workspace = true }
clap = { version = "4.5.0", features = ["derive"] }
pretty_env_logger = "0.5.0"
runtime = { path = "crates/runtime", default-features = false }
http-service = { path = "crates/http-service" }
http-backend = { path = "crates/http-backend" }
hyper-tls = "0.5.0"
19 changes: 19 additions & 0 deletions crates/candle-wasi-nn/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "candle-wasi-nn"
version.workspace = true
edition.workspace = true
publish.workspace = true
authors.workspace = true

[dependencies]
wasmtime-wasi-nn = { workspace = true }
tracing = { workspace = true }
candle-nn = "0.3"

[target.'cfg(target_os = "macos")'.dependencies]
candle-core = { version = "0.3", features = ["accelerate"] }
candle-transformers = { version = "0.3", features = ["accelerate"] }

[target.'cfg(not(target_os = "macos"))'.dependencies]
candle-core = { version = "0.3" }
candle-transformers = { version = "0.3" }
Loading