Skip to content

Commit 9abd96b

Browse files
Merge pull request #13 from tyler-potyondy/dev/gh-workflow
babble-bridge updates to fix gh workflow CI failures
2 parents 9a8fd9b + d0dc48e commit 9abd96b

5 files changed

Lines changed: 22 additions & 26 deletions

File tree

.github/workflows/devcontainer-cargo-test.yml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -121,26 +121,22 @@ jobs:
121121
- name: Chown workspace to container UID 1000
122122
run: sudo chown -R 1000:1000 "$GITHUB_WORKSPACE"
123123

124-
- name: cargo xtask zephyr-setup --build-from-source && cargo test
124+
- name: cargo xtask docker-run zephyr-setup + tests
125+
env:
126+
# This host-side `cargo xtask ...` invocation runs after the workspace
127+
# is chowned for the container user. Keep host artifacts in /tmp so
128+
# host Cargo does not need to write under $GITHUB_WORKSPACE/target.
129+
CARGO_TARGET_DIR: /tmp/cargo-target-host
125130
run: |
126-
docker run --rm \
127-
--platform linux/amd64 \
128-
--memory=6g \
129-
--memory-swap=14g \
130-
-v "$GITHUB_WORKSPACE:/workspace" \
131-
-w /workspace \
132-
-e CARGO_HOME=/tmp/cargo \
133-
-e CARGO_TARGET_DIR=/tmp/target \
134-
nrf-sim-bridge:latest \
135-
bash -lc '
136-
set -euo pipefail
137-
echo "=== cargo xtask zephyr-setup --build-from-source ==="
138-
cargo xtask zephyr-setup --build-from-source
139-
echo "=== cargo test --workspace --lib ==="
140-
cargo test --workspace --lib
141-
echo "=== cargo test --test integration_test ==="
142-
cargo test --test integration_test -- --test-threads=1
143-
'
131+
cargo xtask docker-run -- bash -lc '
132+
set -euo pipefail
133+
echo "=== cargo xtask zephyr-setup --build-from-source ==="
134+
cargo xtask zephyr-setup --build-from-source
135+
echo "=== cargo test --workspace --lib ==="
136+
cargo test --workspace --lib
137+
echo "=== cargo test --test integration_test ==="
138+
cargo test --test integration_test -- --test-threads=1
139+
'
144140
145141
- name: Restore workspace permissions for runner
146142
if: always()

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/target
2+
/external
23
/nrf
34
DESIGN.md
45
tests/raw_rpc

Cargo.lock

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
members = [".", "nrf-rpc-codegen", "xtask"]
33

44
[workspace.dependencies]
5-
babble-bridge = "0.1.1"
5+
babble-bridge = "0.1.3"
66

77
[package]
88
name = "nrf-rpc"

tests/integration_test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use nrf_rpc::ble::{
1616
BtGattDiscoverType, BtGattSubscribeParams, BtLeConnParam, BtLeScanParam, GattDiscoverResult,
1717
ScanResultData,
1818
};
19-
use babble_bridge::{TestProcesses, spawn_zephyr_rpc_server_with_socat};
19+
use babble_bridge::{LogOutput, TestProcesses, spawn_zephyr_rpc_server_with_socat};
2020
use nrf_rpc::{RpcClient, TransportError, ble::Ble, uart_transport::{Uart, UartTransport}};
2121
use std::collections::HashSet;
2222
use std::io::{Read, Write};
@@ -240,7 +240,7 @@ fn hex_to_bytes(hex: &str) -> Vec<u8> {
240240
.collect()
241241
}
242242

243-
const TEST_DIRECTORY_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests");
243+
const TEST_DIRECTORY_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/sockets");
244244
const BSIM_BIN_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/external/tools/bsim/bin");
245245

246246
/// One-shot environment precondition check. Runs the first time any test
@@ -311,7 +311,7 @@ type MockTransport = UartTransport<MockUart>;
311311
fn run_zephyr_rpc_server_exe(test_name: &str) -> (TestProcesses, MockTransport) {
312312
preflight_check();
313313
let tests_dir = Path::new(TEST_DIRECTORY_PATH);
314-
let (processes, socket_path) = spawn_zephyr_rpc_server_with_socat(tests_dir, test_name);
314+
let (processes, socket_path) = spawn_zephyr_rpc_server_with_socat(tests_dir, test_name, LogOutput::Off);
315315
let socket_path_str = socket_path
316316
.to_str()
317317
.expect("socket path must be valid UTF-8");

0 commit comments

Comments
 (0)