From 15991b5c1184b06d2f243dad7479b3de661fe4d2 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Arcos Date: Thu, 18 Apr 2024 14:48:35 +0200 Subject: [PATCH] HIL: Allow manually running tests on other repos/branches (#625) * style: Covnert println to log message * ci: Allow manual trigger in other repo and branch --- .github/workflows/hil.yml | 17 ++++++++++++++++- espflash/src/targets/esp32c2.rs | 6 ++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/hil.yml b/.github/workflows/hil.yml index bf9dde2a..b5dd4222 100644 --- a/.github/workflows/hil.yml +++ b/.github/workflows/hil.yml @@ -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 @@ -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: diff --git a/espflash/src/targets/esp32c2.rs b/espflash/src/targets/esp32c2.rs index 45b42a76..a307e318 100644 --- a/espflash/src/targets/esp32c2.rs +++ b/espflash/src/targets/esp32c2.rs @@ -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::{ @@ -95,11 +97,11 @@ impl Target for Esp32c2 { ) -> Result, 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") } _ => {