Skip to content

Commit

Permalink
HIL: Allow manually running tests on other repos/branches (#625)
Browse files Browse the repository at this point in the history
* style: Covnert println to log message

* ci: Allow manual trigger in other repo and branch
  • Loading branch information
SergioGasquez authored Apr 18, 2024
1 parent 7cd71c8 commit 15991b5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/hil.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ on:
- "**/ci.yml"
- "**/*.md"
workflow_dispatch:

inputs:
repository:
description: "Owner and repository to test"
required: true
default: 'esp-rs/espflash'
branch:
description: "Branch, tag or SHA to checkout."
required: true
default: "main"
env:
CARGO_TERM_COLOR: always

Expand All @@ -31,6 +39,13 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
if: github.event_name != 'workflow_dispatch'

- uses: actions/checkout@v4
if: github.event_name == 'workflow_dispatch'
with:
repository: ${{ github.event.inputs.repository }}
ref: ${{ github.event.inputs.branch }}

- uses: ./.github/actions/setup-target
with:
Expand Down
6 changes: 4 additions & 2 deletions espflash/src/targets/esp32c2.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use std::{collections::HashMap, ops::Range};

use log::debug;

#[cfg(feature = "serialport")]
use crate::{connection::Connection, targets::bytes_to_mac_addr};
use crate::{
Expand Down Expand Up @@ -95,11 +97,11 @@ impl Target for Esp32c2 {
) -> Result<IdfBootloaderFormat<'a>, Error> {
let booloader: &'static [u8] = match xtal_freq {
XtalFrequency::_40Mhz => {
println!("Using 40MHz bootloader");
debug!("Using 40MHz bootloader");
include_bytes!("../../resources/bootloaders/esp32c2-bootloader.bin")
}
XtalFrequency::_26Mhz => {
println!("Using 26MHz bootloader");
debug!("Using 26MHz bootloader");
include_bytes!("../../resources/bootloaders/esp32c2_26-bootloader.bin")
}
_ => {
Expand Down

0 comments on commit 15991b5

Please sign in to comment.