Skip to content
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

feat: add support for wasm addons #182

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1a004fe
setup new plugin development kit (wasm addons)
tsirysndr Aug 23, 2024
1f8424c
expose host functions, add stdout and subprocess audio backend
tsirysndr Aug 24, 2024
c4e472e
expose get_settings host function, update nix flake
tsirysndr Aug 24, 2024
3c76121
try to call functions from the local.wasm plugin
tsirysndr Aug 25, 2024
6f0f47a
[fluentci] update test job
tsirysndr Aug 25, 2024
7452e16
[fluentci] update test job
tsirysndr Aug 25, 2024
6f34767
ci: set DAGGER_CLOUD_TOKEN
tsirysndr Aug 25, 2024
1c3fc68
fix: export `next` and `previous` host functions
tsirysndr Aug 25, 2024
95d24de
update extism host functions
tsirysndr Aug 25, 2024
e3a73ee
remove duplicate load_tracklist definition
tsirysndr Aug 25, 2024
9384b81
exclude addons from coverage
tsirysndr Aug 25, 2024
8d0b5f5
fix cargo llvm cov
tsirysndr Aug 25, 2024
5ee5be1
remove duplicate get_current_track definition
tsirysndr Aug 25, 2024
c9708bc
update tests
tsirysndr Aug 25, 2024
5bb8646
update extism host functions
tsirysndr Aug 25, 2024
ac329c3
[client] update tests
tsirysndr Aug 25, 2024
7ba2ee7
[server] update tests
tsirysndr Aug 25, 2024
78fcd7d
remove unused crate: common
tsirysndr Aug 25, 2024
ec3e539
[graphql] migrate tracklist api into wasm plugin
tsirysndr Aug 25, 2024
d8a9cdd
[graphql/tests] add missing global user_data
tsirysndr Aug 25, 2024
417ff95
[graphql] fix tests
tsirysndr Aug 25, 2024
e831cf4
[storage] fix tests
tsirysndr Aug 25, 2024
f6f2456
[storage] make all tests async fn
tsirysndr Aug 25, 2024
372d3f0
[storage] fix tests
tsirysndr Aug 25, 2024
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
48 changes: 48 additions & 0 deletions .fluentci/src/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const test = async (src = ".") => {
"psmisc",
])
.withExec(["rustup", "component", "add", "llvm-tools"])
.withExec(["rustup", "target", "add", "wasm32-unknown-unknown"])
.withExec([
"wget",
"https://github.com/taiki-e/cargo-llvm-cov/releases/download/v0.5.36/cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz",
Expand All @@ -73,6 +74,39 @@ export const test = async (src = ".") => {
.withExec(["mv", "cargo-llvm-cov", "/usr/local/bin"])
.withDirectory("/app", context, { exclude })
.withWorkdir("/app")
.withExec([
"cargo",
"build",
"-p",
"chromecast",
"--target",
"wasm32-unknown-unknown",
"--release",
])
.withExec([
"cargo",
"build",
"-p",
"dlna",
"--target",
"wasm32-unknown-unknown",
"--release",
])
.withExec([
"cargo",
"build",
"-p",
"local",
"--target",
"wasm32-unknown-unknown",
"--release",
])
.withExec(["mkdir", "-p", "/tmp/addons"])
.withExec([
"sh",
"-c",
"cp target/wasm32-unknown-unknown/release/*.wasm /tmp/addons",
])
.withMountedCache("/app/target", dag.cacheVolume("target"))
.withMountedCache("/root/cargo/registry", dag.cacheVolume("registry"))
.withExec(["cp", "-r", "fixtures/audio", "/tmp"])
Expand All @@ -91,6 +125,20 @@ export const test = async (src = ".") => {
.withExec(["cargo", "install", "--path", "."])
.withExec(["sh", "-c", "rm -rf target/*"])
.withExec(["music-player", "scan"])
.withExec([
"rm",
"-rf",
"addons/chromecast",
"addons/dlna",
"addons/kodi",
"addons/local",
"addons/mopidy",
"addons/mpd",
"addons/mpris",
"addons/squeezebox",
"addons/tunein",
])
.withExec(["cp", "Cargo.llvm-cov.toml", "Cargo.toml"])
.withExec([
"sh",
"-c",
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
uses: actions/checkout@v2
- name: Run Dagger Pipelines
run: fluentci run . test
env:
DAGGER_CLOUD_TOKEN: ${{ secrets.DAGGER_CLOUD_TOKEN }}
- name: Upload to Codecov
run: fluentci run codecov_pipeline
env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
env:
TAG: ${{ env.RELEASE_VERSION }}
TARGET: ${{ matrix.target }}
DAGGER_CLOUD_TOKEN: ${{ secrets.DAGGER_CLOUD_TOKEN }}
- name: Upload release assets
run: |
for ext in tar.gz tar.gz.sha256; do
Expand Down
135 changes: 135 additions & 0 deletions Cargo.llvm-cov.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
[package]
authors = ["Tsiry Sandratraina <[email protected]>"]
categories = ["command-line-utilities"]
description = "An extensible music player daemon written in Rust"
edition = "2021"
keywords = ["tokio", "music", "daemon", "streaming", "player"]
license = "MIT"
name = "music-player"
readme = "README.md"
repository = "https://github.com/tsirysndr/music-player"
version = "0.2.0-alpha.13"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[workspace]

members = [
"addons",
"audio",
"client",
"discovery",
"entity",
"graphql",
"migration",
"playback",
"scanner",
"server",
"settings",
"storage",
"tracklist",
"types",
"webui",
"webui/musicplayer/src-tauri",
"pdk",
"host_fn",
]

[[bin]]
name = "music-player"
path = "src/main.rs"

[dependencies.music-player-server]
path = "server"
version = "0.2.0"

[dependencies.music-player-playback]
path = "playback"
version = "0.1.13"

[dependencies.music-player-scanner]
path = "scanner"
version = "0.1.9"

[dependencies.music-player-entity]
path = "entity"
version = "0.1.7"

[dependencies.music-player-migration]
path = "migration"
version = "0.1.9"

[dependencies.music-player-settings]
path = "settings"
version = "0.1.5"

[dependencies.music-player-storage]
path = "storage"
version = "0.1.8"

[dependencies.music-player-addons]
path = "addons"
version = "0.1.5"

[dependencies.music-player-tracklist]
path = "tracklist"
version = "0.1.8"

[dependencies.music-player-client]
path = "client"
version = "0.1.5"

[dependencies.music-player-webui]
path = "webui"
version = "0.1.15"

[dependencies.music-player-discovery]
path = "discovery"
version = "0.1.3"

[dependencies.music-player-graphql]
path = "graphql"
version = "0.1.10"

[dependencies.music-player-types]
path = "types"
version = "0.1.6"

[dependencies.music-player-audio]
path = "audio"
version = "0.1.6"

[dependencies.sea-orm-migration]
features = [
# Enable at least one `ASYNC_RUNTIME` and `DATABASE_DRIVER` feature if you want to run migration via CLI.
# View the list of supported features at https://www.sea-ql.org/SeaORM/docs/install-and-config/database-and-async-runtime.
# e.g.
# "runtime-tokio-rustls", # `ASYNC_RUNTIME` feature
# "sqlx-postgres", # `DATABASE_DRIVER` feature
"runtime-tokio-rustls",
"sqlx-sqlite",
]
version = "^0.9.0"

[dependencies]
anyhow = "1.0.67"
clap = "4.5.16"
crossterm = {version = "0.25.0", features = ["serde"]}
dirs = "4.0.0"
extism = "1.5.0"
futures = "0.3.24"
futures-channel = "0.3.24"
lofty = "0.9.0"
md5 = "0.7.0"
music-player-host-fn = {path = "host_fn", version = "0.1.0"}
owo-colors = "3.5.0"
reqwest = {version = "0.12.7", features = ["rustls-tls", "blocking"], default-features = false}
sea-orm = {version = "0.9.2", features = ["runtime-tokio-rustls", "sqlx-sqlite"]}
serde_json = "1.0.85"
spinners = "4.1.0"
tabled = "0.8.0"
time = "0.3.36"
tokio = {version = "1.21.0", features = ["full"]}
tui = {version = "0.19.0", features = ["crossterm", "serde"]}
tungstenite = "0.17.3"
ureq = "2.10.1"
Loading
Loading