Skip to content
Open
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
37 changes: 35 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,46 @@ jobs:

- name: Install Dioxus CLI
run: cargo binstall -y dioxus-cli

- name: Prefetch dependencies
run: |
cargo fetch --locked || {
echo "Locked prefetch failed; falling back to non-locked fetch (lockfile likely outdated).";
cargo fetch;
}

- name: Build Project
run: cargo make build

test_integration:
name: Integration Tests
runs-on: freenet-default-runner
needs: build

strategy:
max-parallel: 1

env:
FREENET_LOG: error
CARGO_TARGET_DIR: ${{ github.workspace }}/target

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: wasm32-unknown-unknown

- uses: Swatinem/rust-cache@v2
with:
shared-key: "rust-cache"
save-if: ${{ github.ref == 'refs/heads/main' }}

- name: Run River Integration Tests
run: cargo test --package room-contract
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ bs58 = "0.5.1"
# Utilities
byteorder = "1.5.0"
rand = { version = "0.8.5", features = ["getrandom"], default-features = true }
getrandom = { version = "0.2.16", features = ["js"] }
base64 = "0.22.1"
once_cell = "1.18.0"
data-encoding = "2.3.3"
Expand All @@ -48,7 +49,7 @@ river = { path = "cli", package = "river" }
# Freenet dependencies
freenet-scaffold = "0.2.1"
freenet-scaffold-macro = "0.2.1"
freenet-stdlib = { version = "0.1.13", features = ["contract"] }
freenet-stdlib = { version = "0.1.14", features = ["contract"] }

[workspace.package]
version = "0.1.0"
Expand Down
4 changes: 2 additions & 2 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ clap = { version = "4.5", features = ["derive", "env"] }
tokio = { version = "1.42", features = ["full"] }

# WebSocket client
tokio-tungstenite = { version = "0.26", features = ["native-tls"] }
tokio-tungstenite = { version = "0.27", features = ["native-tls"] }

# Serialization
serde = { version = "1.0.130", features = ["derive"] }
Expand All @@ -46,7 +46,7 @@ atty = "0.2"

# Internal dependencies
river-core = { version = "0.1.0", path = "../common" }
freenet-stdlib = { version = "0.1.13", features = ["net"] }
freenet-stdlib = { version = "0.1.14", features = ["net"] }
freenet-scaffold = "0.2.1"

# Serialization (for contract state)
Expand Down
12 changes: 6 additions & 6 deletions cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ use std::path::Path;

fn main() {
println!("cargo:rerun-if-changed=build.rs");

// Get the output directory
let out_dir = env::var("OUT_DIR").unwrap();
let dest_path = Path::new(&out_dir).join("room_contract.wasm");

// Try to find the WASM file in several locations
let possible_paths = [
// When building from workspace
Expand All @@ -19,9 +19,9 @@ fn main() {
// This file MUST be committed to the repo for publishing
"contracts/room_contract.wasm",
];

let mut wasm_found = false;

for path in &possible_paths {
if Path::new(path).exists() {
println!("cargo:rerun-if-changed={}", path);
Expand All @@ -31,7 +31,7 @@ fn main() {
break;
}
}

if !wasm_found {
// For crates.io publishing, we need the WASM file to be included
// Create a dummy file or panic based on whether this is a docs build
Expand All @@ -45,4 +45,4 @@ fn main() {
);
}
}
}
}
Loading