Skip to content

Commit

Permalink
ci: Enable other targets
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioGasquez committed Jan 2, 2024
1 parent bb5a7b5 commit 0f2e0a6
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 38 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/hil.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ jobs:
# target: riscv32imc-unknown-none-elf
- mcu: esp32c3
target: riscv32imc-unknown-none-elf
# - mcu: esp32c6
# target: riscv32imac-unknown-none-elf
# - mcu: esp32h2
# target: riscv32imac-unknown-none-elf
# - mcu: esp32s2
# target: xtensa-esp32s2-none-elf
- mcu: esp32c6
target: riscv32imac-unknown-none-elf
- mcu: esp32h2
target: riscv32imac-unknown-none-elf
- mcu: esp32s2
target: xtensa-esp32s2-none-elf
- mcu: esp32s3
target: xtensa-esp32s3-none-elf
fail-fast: false
Expand Down Expand Up @@ -80,8 +80,7 @@ jobs:
runs-on: [self-hosted, linux, x64, "${{ matrix.board }}" ]
strategy:
matrix:
# board: [esp32, esp32c2, esp32c3, esp32c6, esp32h2, esp32s2, esp32s3]
board: [esp32, esp32c3, esp32s3]
board: [esp32, esp32c2, esp32c3, esp32c6, esp32h2, esp32s2, esp32s3]
fail-fast: false
steps:
- uses: actions/checkout@v4
Expand Down
60 changes: 30 additions & 30 deletions espflash/tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,36 @@ fn cli_tests() -> Result<(), Box<dyn std::error::Error>> {
assert!(output_stdout.contains("esp32"));
assert!(output_stdout.contains("revision"));

// // flash
let image = std::env::var("ESPFLASH_APP").expect("ESPFLASH_APP not set");

let mut child = Command::cargo_bin("espflash")?
.args(&["flash", "--monitor", &image])
.stdout(std::process::Stdio::piped())
// .stderr(std::process::Stdio::piped())
.spawn()?;

// // Sleep for 10 seconds
sleep(Duration::from_secs(10));

// Check if the child process is still running
match child.try_wait() {
Ok(Some(_status)) => {
// The process has terminated
}
Ok(None) => {
// The process is still running, kill it
child.kill().expect("command wasn't running");
child.wait().expect("unable to wait on child");
}
Err(e) => {
panic!("Error attempting to wait on child: {}", e);
}
}

let output = child.wait_with_output().expect("Failed to read stdout");
let output = String::from_utf8_lossy(&output.stdout).to_string();
assert!(output.contains("Hello world!"));
// // // flash
// let image = std::env::var("ESPFLASH_APP").expect("ESPFLASH_APP not set");

// let mut child = Command::cargo_bin("espflash")?
// .args(&["flash", "--monitor", &image])
// .stdout(std::process::Stdio::piped())
// // .stderr(std::process::Stdio::piped())
// .spawn()?;

// // // Sleep for 10 seconds
// sleep(Duration::from_secs(10));

// // Check if the child process is still running
// match child.try_wait() {
// Ok(Some(_status)) => {
// // The process has terminated
// }
// Ok(None) => {
// // The process is still running, kill it
// child.kill().expect("command wasn't running");
// child.wait().expect("unable to wait on child");
// }
// Err(e) => {
// panic!("Error attempting to wait on child: {}", e);
// }
// }

// let output = child.wait_with_output().expect("Failed to read stdout");
// let output = String::from_utf8_lossy(&output.stdout).to_string();
// assert!(output.contains("Hello world!"));

// // monitor
// let mut cmd: Command = Command::cargo_bin("espflash")?;
Expand Down

0 comments on commit 0f2e0a6

Please sign in to comment.